Write a program that prints pointer values, using casts to all the integer data types. Which ones print strange values? Which ones cause errors?
What will be an ideal response?
```
#include
using namespace std;
int main()
{
// string to cast into integer formats
char *string = "test";
// display data stored in string and
// address of string using static_cast
cout << "Value of string is : " << string << '\n'
<< "Value of static_cast
<< static_cast
// The following generate errors.
// reinterpret_cast will allow this type of casting.
// See Ch. 24 for a discussion of reinterpret_cast.
/* << "Value of static_cast
<< static_cast
<< "Value of static_cast
<< static_cast
<< "Value of static_cast
<< static_cast
<< "Value of static_cast
<< static_cast
<< "Value of static_cast
<< static_cast
*/
<< endl;
} // end main
```
Value of string is : test
Value of static_cast
You might also like to view...
A cell value that depends on the value in another cell is known as a(n) ________ of that cell
A) dependent B) delimiter C) precedent D) subtotal
A(n) __________ is used to disseminate information that an organization wishes to publish.
Fill in the blank(s) with the appropriate word(s).
Websites that allow users to communicate with each other using text, audio, video, whiteboard, and shared files are called _____ workspaces.
A. collaborative B. cloud C. home office D. community
Briefly describe the Compatible Module selection for electronic keying.
What will be an ideal response?