why does printing address of c string returns the entire string?
let's say I have a char cString[] {"HELLO WORLD"}
1. why does printing out the &cString[0] returns the entire string or &cString[1] will return a substring of cString and it does not return a hexadecimal address like other primitive array?
for example:
if I print &intArray[0] It will print a hexadecimal address out unlike the &cString[0] which will print out the entire string.
It's as by design. cout treats a type of char * as a pointer to a c-style null terminated string and displays that string. If you want to display the address of a char* type then first cast to void *