+ 4
Char *a="12345"; Char*b=++a; Cout<< *++b; Explain me this code
4 odpowiedzi
+ 10
When you preincrement a using ++a, you effectively move the pointer to the next character('2') in the string. The address of this char is also assigned to b which is a second char pointer. In the third line, b is incremented further to point to the next char ('3'). The * in front is used to dereference the pointer to get the actual character value and this is then inserted into the standard output stream which effectively prints '3' on the console screen.
+ 4
char is a character data type. char* is a pointer to a character which can also be the first character in an array or string of characters like "12345".
+ 2
It's char and not chat.
+ 2
Ok thanks got it