code
code, coding, computer @ Pixabay

We are going to use the following code for this blog post: cout << *ptr; What will it output? Well, we can’t be sure. This is because cout (the console operator) and ptr (a pointer variable) have different types. The only thing that we know for certain is that it won’t compile if you try to run this code because of the difference in type. What Should You Do? Well, you need to make sure that cout and ptr both have the same type. If they don’t then it will not compile because of a difference in types. What will it output? We can’t be sure! This is because cout (the console operator) and ptr (a pointer variable) have different types. The only thing we know for certain is that it won’t compile if you try running this code due to the difference in type. What should you do? Well, you need to make sure that cout and ptr both have the same type so there’s no risk of compilation errors

LEAVE A REPLY

Please enter your comment!
Please enter your name here