why &cs won't give the address of the pointer which store the starting address
of the cstring cs?
is it because the addressof operator is overloaded to directly return the address of the cstring?
does the first way (char *s) of creating cstring allocate memory in the heap?
or both method allocate memory in the stack?
cs is an array so &cs gives you a pointer to the first element in the array.
char *s="hello"; Here s is a pointer to the string. Only the pointer is allocated on the "stack". To be strict it should constchar *s="hello"; because you are not allowed to change what s is pointing to.
char cs[]="hello"; This creates the array on the "stack".