I just tried this code:
int i = 33; int * pi = &i; cout << "i: " << *pi << endl; cout << "i: " << pi[0] << endl;
Both lines return the same thing.
Essentially, if I get the null index of any pointer, I get a value of the correct type at the location of the pointer. Isn't that the same thing as acting out?
Every time a pointer is dereferenced in C ++, will it not get a null index? I do not suggest that anyone actually do this, but I think it will work. Is not it?
source share