Why does the array name print strings in c++?

Viewed 34

In C,

char a[3] = "a";
printf("%u %u",a,&a);

a and &a both print the address.
I learned that an array name represents the address of the first element.

But in C++,

char arr[30] = "string";
cout << arr;

When I tried to print this, I found out that the computer prints strings, not an address.
Why does the array name print strings, not an address? Why is this happening in c++?

0 Answers
Related