The table below shows the contents of several memory locations. All numbers are
ID: 3800218 • Letter: T
Question
The table below shows the contents of several memory locations. All numbers are shown in decimal.
1028
1056
1076
d
1008
1016
1032
1088
f
Using these values evaluate each of the expressions four ways. First assume that each of the variables are integers and define the expressions R-value. then find its L-value, and give the address of the location its specifies. Next assume all variable are pointers to integers and repeat the exercise.
Address Contents a 10401028
c1056
1076
d
1008
1016
e1032
1088
f
1052 1044 g 1000 1064 h 1080 1020 i 1020 1080 j 1064 1000 k 1044 1052 m 1016 1008 n 1076 1056 o 1096 1924 q 1084 1072 r 1068 1048 s 1004 2000 t 1060 1012 u 1036 1092Explanation / Answer
v - w = //undefined //undefined
&c = 1056 1056
&e + 1 = 1032+2 = 1034 1032 + 4 = 1036
&o – 4 = 1096 – 4*2 = 1088 1096 – 4*4 = 1088
&(f + 2) = //error //error
*g = 1000 1000
*k + 1 = 1045 1044 + 1*4 = 1048
*( n + 1) = no data at 1057 no data at 1058
*h – 4 = 1076 1080 – 4*2 = 1072
Column 1 is for: First assume that each of the variables are integers and define the expressions R-value. then find its L-value, and give the address of the location its specifies.
column 2 is for assume all variable are pointers to integers and repeat the exercise.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.