Answered step by step
Verified Expert Solution
Question
1 Approved Answer
10. (10 points) Study each of the following pieces of code. If nothing wrong in the code, simply answer it and indicate what will get
10. (10 points) Study each of the following pieces of code. If nothing wrong in the code, simply answer it and indicate what will get printed out when this piece of code is executed. If something wrong, please point it out and explain what is wrong (again, answer without correct explanation won't receive full credit) a. char s[] = "abc"; char * p = s; *p = 'A'; print("%s ", s); b. char str[] = "abc"; const char *p = str; *(p + 1) = 'B'; - 7 - printf("%s ", p); int x = 8, n = 6; const int * const p = &x; X = n; printf("%d ", *p)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started