-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOpp.cpp
More file actions
48 lines (43 loc) · 795 Bytes
/
Opp.cpp
File metadata and controls
48 lines (43 loc) · 795 Bytes
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
45
46
47
48
#include <bits/stdc++.h>
using namespace std;
class A{
public:
int a;
A(int a){
this->a = a;
}
// virtual void a()=0;
};
// class B: public A{
// public:
// void a(){
// cout<<"B"<<endl;
// }
// };
// class C: public A {
// A *ob;
// public:
// void set(A *ob){
// this->ob = ob;
// }
// void a(){
// cout<<"C"<<endl;
// ob->a();
// }
// };
int main() {
// C *obj = new C();
// C *obj2 = new C();
// obj->set(obj2);
// obj->a();
// int *ptr = NULL;
// int a = 3;
// int &b = a;
// cout<<&b<<" "<<&a<<endl;
// array<int, 5> arr = {3,2,4,2,3};
// cout<<arr.at(6);
// if(ptr==NULL) cout<<1<<endl;
A *obj = new A(3);
cout<<obj->a;
return 0;
}