1 #include <ctime>
2 #include <iostream>
3 #include <cstdint>
4
5 using namespace std;
6
7 int main ( int argc,char * argv[]){
8 int a[20] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
9
10 int back = 100;
11 long int b[100] = {0};
12 for(int * ptr = a, *last = a + 20; ptr < last; ptr++){
13 cout << *ptr << endl;
14 *ptr = back--;
15 }
16 cout << "Section 1 finished " << endl << endl;
17
18 for(int * ptr = a, *last = a + 20; ptr < last; ptr++){
19 cout << *ptr << endl;
20 }
21 cout << "Section 2 finished " << endl << endl;
22
23 for(long int *ptr = b, *last = b + 100, val=0; ptr < last; ptr++, val++){
24 *ptr = val;
25 }
26
27 cout << "Section 3 finished " << endl << endl;
28
29 for(long int *ptr = b, *last = b + 100, val=0; ptr < last; ptr++, val++){
30 cout << *ptr << endl;
31 }
32
33 cout << "Section 4 finished " << endl << endl;
34
35 int index = 0;
36 int var = 10;
37
38 while(var not_eq b[index]){
39 cout << "Index " << index << " is not 10" << endl;
40 b[index] = 10000000;
41 index++;
42 }
43 cout << "Index " << index << " is 10" << endl;
44
45 cout << "Section 5 finished " << endl << endl;
46
47 for(long int *ptr = b, *last = b + 100, val=0; ptr < last; ptr++, val++){
48 cout << "Array Values==>" << val << "==>" << *ptr << endl;
49 }
50 cout << endl << endl;
51
52 cout << "Section 6 finished " << endl << endl;
53 var = 100;
54 index = 0;
55 while(var not_eq index){
56 time_t sec = time(NULL);
57 b[index] = static_cast<long unsigned int>(sec) % static_cast<long unsigned int >(index);
58 index++;
59 }
60
61 for(long int *ptr = b, *last = b + 100, val=0; ptr < last; ptr++, val++){
62 cout << "Array Values==>" << val << "==>" << *ptr << endl;
63 }
64
65 cout << "Section 7 finished " << endl << endl;
66
67 return 0;
68 }
69
70