G
Gary
I've always taught that arrays are not pointers. So how come I can do:
#include <iostream>
#include <cstdlib>
using namespace std;
int main( )
{
int myArray[10]={1, 10};
cout << sizeof(myArray) << endl;
cout << sizeof(myArray+1) << endl;
cout << *myArray << endl;
cout << *(myArray+1) << endl;
system("Pause");
return 0;
}
/*results are
40
4
1
10
*/
#include <iostream>
#include <cstdlib>
using namespace std;
int main( )
{
int myArray[10]={1, 10};
cout << sizeof(myArray) << endl;
cout << sizeof(myArray+1) << endl;
cout << *myArray << endl;
cout << *(myArray+1) << endl;
system("Pause");
return 0;
}
/*results are
40
4
1
10
*/