-
Notifications
You must be signed in to change notification settings - Fork 0
/
dyb.cpp
44 lines (34 loc) · 902 Bytes
/
dyb.cpp
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
37
38
39
40
41
42
43
44
#include <iostream>
using namespace std;
int main()
{
/* int* array_ptr{ nullptr };
int size;
cout << "how big do you want" << endl;
cin >> size;
array_ptr = new int[size];
delete [] array_ptr;
*/
int scores[] {100,95,89};
cout<< "values of scores"<<scores<<endl;
int *score_ptr{scores};
cout<<"values of score_ptr"<<endl;
cout <<"Array1"<<endl;
cout<<scores[0]<<endl;
cout<<scores[1]<<endl;
cout<<scores[2]<<endl;
cout <<"Array2"<<endl;
cout<<score_ptr[0]<<endl;
cout<<score_ptr[1]<<endl;
cout<<score_ptr[2]<<endl;
cout <<"Array3"<<endl;
cout<<*score_ptr<<endl;
cout<<*(score_ptr+1)<<endl;
cout<<*(score_ptr+2)<<endl;
cout <<"Array4"<<endl;
cout<<*scores<<endl;
cout<<*(scores+1)<<endl;
cout<<*(scores+2)<<endl;
cout << endl;
return 0;
}