Question: Use the following code to answer the question. #define STRLEN 20 char mystring[STRLEN] = I love CS!; char *cp = &mystring[4]; Assume that the first
Use the following code to answer the question.
#define STRLEN 20
char mystring[STRLEN] = "I love CS!";
char *cp = &mystring[4];
Assume that the first byte of array mystring has address x. For each of the following expressions of type pointer to char, tell (i) the value of the expression, i.e., the address it refers to, and (ii) the value contained in the byte at that address. If it is not possible to tell the value, write unknown. As an example, for the expression cp, you would answer (i) x + 4, and (ii) v.
A) cp+6
B) cp[19]
C) cp-9
D) cp[-1]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
