+ 2
What is the output?
When doing challenges I get the question where there's a char pointer p with multiple letters asigned to it and then I get to cout an incremented value of it. I can never get the answer right. I've tried compiling it but I get errors. Could anyone give me an example of the code and what it outputs?
3 Respuestas
+ 3
already know it. "a" is the output. The pointer is equal to the first letter. Adding anything to it moves it to other letters that much. Trying to output it without the * makes it ouput the remainig letters from the one the pointer outputs with the * (including it) and without the previous ones
+ 2
char *p = "abcde";
cout << *p++;
0
If you post your code, sure thing (;