February 12th, 2010, 12:45 AM
Works for me, thanks for the help.
February 12th, 2010, 12:18 AM
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, 11: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, 11: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;