1. Assume that the array array_one is stored as follows. Show the contents of th
ID: 3705786 • Letter: 1
Question
1. Assume that the array array_one is stored as follows. Show the contents of the array at this point where no changes have been made.
ADDRESS
CONTENTS
VARIABLE
1428
2
array_one[0]
1432
4
array_one [1]
1436
6
array_one [2]
1440
8
array_one [3]
1444
10
array_one [4]
1448
12
array_one [5]
1452
14
array_one [6]
1456
16
array_one [7]
1460
18
array_one [8]
1464
20
array_one [9]
What is output by the following three lines?
cout << array_one << endl; _________________________
cout << *(array_one + 3) << endl; _________________________
cout << *array_one << endl; _________________________
Assume that the following statements are executed making changes to the array array_one.
*array_one = 3;
array_one[2] = 5;
*(array_one + 4) = 7;
array_one[8] = *array_one + 1;
p_data = array_one + 9;
*p_data = 11;
*(p_data - array_one[1]) = 13;
p_data -= 3;
*p_data = 17;
p_data++;
*p_data = array_one[array_one[2]];
Show the contents of the array at this point following the changes made by the code above.
ADDRESS
CONTENTS
VARIABLE
1428
array_one[0]
1432
array_one [1]
1436
array_one [2]
1440
array_one [3]
1444
array_one [4]
1448
array_one [5]
1452
array_one [6]
1456
array_one [7]
1460
array_one [8]
1464
array_one [9]
ADDRESS
CONTENTS
VARIABLE
1428
2
array_one[0]
1432
4
array_one [1]
1436
6
array_one [2]
1440
8
array_one [3]
1444
10
array_one [4]
1448
12
array_one [5]
1452
14
array_one [6]
1456
16
array_one [7]
1460
18
array_one [8]
1464
20
array_one [9]
Explanation / Answer
Hi Dear,
I have answer Part I, question is long, so please post other part : after change in array_one, in separate post.
1. Address of the first block of array_one
cout << array_one << endl; _________________________
Answer: 1428
2. 4th number in the array
cout << *(array_one + 3) << endl; _________________________
Answer: 8
3. First number in the array
cout << *array_one << endl; _________________________
Answer: 2
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.