1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <vector>
using namespace std;
int main() /* Line 1 */
{ /* Line 2 */
vector <int *> iv; /* Line 3 */
vector <int> jv; /* Line 4 */
int *ip, *jp, *kp; /* Line 5 */
/* Line 6 */
ip = new int; /* Line 7 */
jp = new int; /* Line 8 */
kp = new int; /* Line 9 */
/* Line 10 */
*ip = 22; /* Line 11 */
*jp = 33; /* Line 12 */
*kp = 44; /* Line 13 */
/* Line 14 */
iv.push_back(ip); /* Line 15 */
iv.push_back(jp); /* Line 16 */
/* Line 17 */
jv.push_back(*(iv[1])); /* Line 18 */
jv.push_back(*(iv[0])); /* Line 19 */
/* Line 20 */
*(iv[0]) = *kp; /* Line 21 */
kp = jp; /* Line 22 */
/* Line 23 */
cout << *ip << endl; /* Line 24 */
cout << *jp << endl; /* Line 25 */
cout << *kp << endl; /* Line 26 */
cout << *(iv[0]) << endl; /* Line 27 */
cout << *(iv[1]) << endl; /* Line 28 */
cout << jv[0] << endl; /* Line 29 */
cout << jv[1] << endl; /* Line 30 */
return 0; /* Line 31 */
} /* Line 32 */
Behold the program to the right.
*ip: 44
*jp: 33
*kp: 33
*iv[0]: 44
*iv[1]: 33
jp[0]: 33
jp[1]: 22
No Class Stats, PDF Download