CPA practice question 21 of 30

Point out an error in the program. #include using namespace std; int main() { char s1[] = "Hello"; char s2[] = "world"; char *const ptr = s1; *ptr =…

Choose your answer, then check it against the explanation.

Point out an error in the program. #include using namespace std; int main() { char s1[] = "Hello"; char s2[] = "world"; char *const ptr = s1; *ptr = 'a'; ptr = s2; return 0; }
Answer options
Question 21 of 30

Keep practicing

Take the free CPA practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other CPA practice questions

Scroll to Top