Check my answer please

int x = 7;
int *ptr = &x;

a.) What will be displayed if you send the expression *iptr to cout?

7 will be displayed

b.) What happens if you send the expression ptr to cout?

Display address of x

Are these right?
Last edited on
There are these interesting things called compilers. You can put your code in a file, invoke the compiler on the source files, and run the resulting executable. In that way, you can check what simple code does for yourself.

There are even online versions of these compilers, so if you've internet access that lets you post here, you can probably use an online compiler!
Ya I know, but I my visual studio loads slow okay. If it's simple can't you just say if it's right or wrong instead of writing a paragraph..
Last edited on
I'm getting error when I run anyway.
So I did run it and your answer is correct. Just a heads up, but a program like http://www.tutorialspoint.com/compile_cpp11_online.php can be useful if you don't want to run it on your computer as it is slow.

Also, there is a typo and it should be *ptr instead of *iptr.
Last edited on
Topic archived. No new replies allowed.