There is an operator>> overload for const char* that prints the C string the pointer is pointing to (or at least it would be good if it was pointing to one).
It would make no sense for other types, because we generally don't have null-terminated int arrays or null-terminated float arrays...
Yes that prints the first element, i was just wondering why with a c string the entire "array" of characters is printed if i say cout << a << endl;
but if i do that with an array of ints its not the same
AFAIK, in char * it would print the value of what pointer is point to, until null-terminated escape character is found. on int, it would print an address of the int because char * is used for characters-array, but it won't work if you write * a for accessing the pointer value for the entire array, so the way we can access the entire arrays is through the address of the first character the pointer point to.
If cout didn't treat a pointer to char that way, the only way for it to print a string literal would be to create a temporary string object, copy the literal to the string object, and then destroy the temporary string object.