You are on page 1of 2

1: ////////////////Created by Faizullah//////

2: /////////////////Roll No 521243///////////
3: /////////////////Dept: BSSE /////////////
4: /////////////////Semester 3rd M //////////
5: #include<iostream.h>
6: #include<conio.h>
7: class DoublePointer{
8: private:
9: int a[3];
10: int b[3];
11: int c[3];
12: int* n[3];
13: int** p;
14: int i;
15: public:
16: takeValue(){
17: cout<<"The array Store the values ";
18: cout<<"and show its Double Pointer"<<endl;
19: cout<<"Enter the values in a "<<endl;
20: for(i=0;i<3;i++)
21: cin>>a[i];
22: cout<<"Enter the values in b "<<endl;
23: for(i=0;i<3;i++)
24: cin>>b[i];
25: cout<<"Enter the values in c "<<endl;
26: for(i=0;i<3;i++)
27: cin>>c[i];
28: }
29: int assign(){
30: n[0]=&a[0];
31: n[1]=&b[0];
32: n[2]=&c[0];
33: p=n;
34: }
35: int aShowValue(){
36: cout<<"The values in a[1-3] and adress in memory is "<<endl;
37: for(i=0;i<3;i++)
38: cout<<*(*p+i)<<"\t"<<*p+i<<endl;
39: cout<<endl;
40: }
41: int bShowValue(){
42: cout<<"The values in b[1-3] and adress in memory is "<<endl;
43: for(i=3;i<6;i++)
44: cout<<*(*p+i)<<"\t"<<*p+i<<endl;
45: cout<<endl;
46: }
47: int cShowValue(){
48: cout<<"The values in c[1-3] and adress in momery is "<<endl;
49: for(i=6;i<9;i++)
50: cout<<*(*p+i)<<"\t"<<*p+i<<endl;
51: cout<<endl;
52: }
53: };
54: void main(){
55: clrscr();
56: DoublePointer D_ptr;
57: D_ptr.takeValue();
58: D_ptr.assign();
59: D_ptr.aShowValue();
60: D_ptr.bShowValue();
61: D_ptr.cShowValue();
62: getch();
63: }
64:
65:
66:

You might also like