|
#include <iostream>
#include
<vector>
int main(void) {
char a[] = "HELLO";
std::cout << a
<< std::endl;
return 0;
}
|
See above code
I learn from the book that
In char a[] = "HELLO"; a is automatically degraded to the pointer of the first element of array,
Here it should be 'H'
So a is a pointer
But when printing a ,
I get HELLO
Why?
No comments:
Post a Comment