FOR C PROGRAMMING LANGUAGE ; please provide detailed explanation with detailed diagram
Draw the main memory diagram as captured at the end of the C program (i.e. return 0; statement). Your diagram must clearly shows where str, p1, p2, and p3 are pointing to, when the program terminates.
int main(void) {
char str[] = "cs111 NYU"; char* p1 = str;
p1 ++;
char** p2 = &p1;
char* p3 = &str[4];
printf("1. str = %s\n", p1); if(p3 - p1 == 4) {
printf("2. p1 == p3\n"); }
printf("3. char1 %c, char2 %c\n", *(*p2 + 2) + 1, *(*p2 + 2 + 1));
return 0; }
Get Answers For Free
Most questions answered within 1 hours.