Code:
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
char testChar[] = {'a','b','c'};
char *testPointer = testChar ;
cout << testPointer << endl;
return 0;
}
Question:
When I use cout << mypointer,
- Why does to print each letter of the array and the mess(refer to output) at the end? My assumption is when I see out the pointer points to the first letter prints then the second then etc and prints the stuff at the end.
- What is the mess (refer to output) at the end , the address?
Comments:
- I know at the end of the array there's suppose to be a null pointer right?
- I learnt this a year ago and forget please help me recall what is going on.
Output:
abc 310 367 277_ 377
Program ended with exit code: 0