Does this differ in C++? In C++ are arrays not glorified pointers?
To demonstrate:
I was hoping you would demonstrate the difference yourself using sizeof as was mentioned earlier, but you did not
To demonstrate:
Code:
#include <iostream>
int main() {
char pointer[] = "keira";
char* otherPointer = pointer;
std::cout << sizeof(pointer) << " " << sizeof(otherPointer) << std::endl;
return 0;
}
On my system, the output is "6 4". Basically, C++ has the same distinction between arrays and pointers as C.