February 11th, 2010 11:45 PM
Works for me, thanks for the help.
February 11th, 2010 11:18 PM
The address of that block is myarray, not myarray[0]. myarray[0] would be 5, yes? The address of that block of memory is myarray so what exactly is &myarray... is it also the address of that block...
February 11th, 2010 10:48 PM
I like the answer but where is "c" stored (is it even stored anywhere)? I mean, it has to be stored in memory somewhere, right? This kind of goes back to my example of "a" where cout << a; prints...
February 11th, 2010 10:15 PM
Consider the following code:
int a = 5;
cout << a << " " << &a;
Obviously "a" prints out 5 and &a prints out the address of a. Now this code:
int * b = new int[2];
cout << b << " " << &b;