Q:

What does the following program do?

0

What does the following program do?

const char ca[] = {'h', 'e', 'l', 'l', 'o'};
const char *cp = ca;
while (*cp) {
cout << *cp << endl;
++cp;
}

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Since there is no null character at the end, the program will print all the characters in `ca` and continue print whatever in memeory until it find a null character.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now