Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3. Evaluate pointer expressions (40 points) The table below lists a set of C var

ID: 3851983 • Letter: 3

Question

3. Evaluate pointer expressions (40 points) The table below lists a set of C variables, their address, and their values. For each expression below, show what it evaluates to . Assume that an expression evaluating to true always has the value 1 Also, assume that char and int are the same size and both take up one location in LC-3 memory . Also, assume the expressions are evaluated independently without updates . In the case of arrays, the initial values should be interpreted with the same meaning as C array initializers Hint: If a pointer is used to dereference a memory location either using array notation or pointer notation, the resulting type of the expression must match the base type of the pointer, regardless of what might actually be in memory . Variable Base Value(s) int a int b char c int* d int e[10] Address 0xFF00 0xFF01 0xFF02 0xFF03 0xFF04 -20 0xFF00 (1,1,2,3, 5,8,13 ,21,34,0 int** f 0x3104 0xFF03 char str [50] 0x3105 "The wave of the future is technology"

Explanation / Answer

the wave of the future

is technology

3

expression value *d 3 str

the wave of the future

is technology

a*b -60 e[a] 3 e[5] 8 (*f)[10] *d + 1 4 f[10] *(d+1) {1,1,2,3,5,8,13,21,34,,0} d[2] str[0] t str[1] h *f 0xFF00 f 0xFF03 **f

3

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote