I have an array of chars like this one:
char arr[3]="hi";
cout << arr;// this will print out hi
So is the operator<< has an overloaded version that takes an ostream object and char *. so cout<<arr; first arr will decays to a chat * . and then operator<<() will print out what the char pointer is pointing to until it find a null-character ?
The same question for cin>>arr; how does it work with operator>> that takes an array as the second operand.
Your
ostreamandistreamdo haveoperator<<andoperator>>overloaded to take achar*, and arrays decay into pointers to the first element. So, yes it does what you say it does.