Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions