0
Why this code is printing whole string?. When we write string or int in place of char datatype then, it gives us address why?
3 Antworten
+ 2
Only char array get treated special. All other arrays are addresses. structures display address too. The char arrays are special because they are the default string type.
+ 1
string is a class which does not get handled by cin or cout, unless you provide a function to do so. C++ does not provide one so the default action is display the instance's address. Arrays beyond char also do not know hold to display them.
0
So what about integer arrays?.They also display address