Repository navigation
Expand file tree
/
Copy pathdynamic.cpp
More file actions
196 lines (191 loc) · 3.43 KB
/
Copy pathdynamic.cpp
File metadata and controls
196 lines (191 loc) · 3.43 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<cstring>
using namespace std;
// class s{
// char *name;
// int l;
// public:
// s(){
// l=0;
// name= new char [l+1];
// }
// s(char *ss){
// l=strlen(ss);
// name=new char [l+1];
// strcpy(name,ss);
// }
// void display(void){
// cout<<name;
// }
// void join(s &a,s &b)
// {
// l=a.l+b.l;
// name=new char [l+1];
// strcpy(name,b.name);
// strcat(name,a.name);
// }
// };
// int main(){
// s s1("neha"),s2("patel"),s3("yogeshkumar"),s4,s5;
// s1.display();
// s2.display();
// s3.display();
// s4.join(s1,s2);
// s5.join(s4,s3);
// s4.display();
// s5.display();
// }
#include <iostream>
using namespace std;
// class mat {
// int **p;
// int x, y;
// public:
// mat(int m, int n) {
// x = m;
// y = n;
// p = new int*[x];
// for(int i = 0; i < x; i++) {
// p[i] = new int[y];
// }
// }
// void get(int i, int j, int v1) {
// p[i][j] = v1;
// }
// int &put(int i, int j) {
// return p[i][j];
// }
// };
// int main() {
// int m1, n1, v1;
// cin >> m1 >> n1;
// mat a(m1, n1);
// for(int i = 0; i < m1; i++) {
// for(int j = 0; j < n1; j++) {
// cin >> v1;
// a.get(i, j, v1);
// }
// }
// cout << a.put(1, 1) << endl;
// return 0;
// }
// #include<iostream>
// using std::cout;
// using std::endl;
// class Test {
// const int t;
// int i;
// public:
// Test(): i(3) {
// }
// void print() {
// cout << i << " " << endl;
// }
// };
// int main() {
// Test t0;
// t0.print();
// return 0;
// }
// #include<iostream>
// using std::cout;
// using std::endl;
// class Test {
// const int t;
// int i;
// public:
// Test(): i(3), t(i * 2) {
// }
// void print() {
// cout << i << " " << t << endl;
// }
// };
// int main() {
// Test t0;
// t0.print();
// return 0;
// }
// #include<iostream>
// using std::cout;
// using std::endl;
// class Test {
// const int t;
// int i;
// public:
// Test(int num): i(t * num), t(3) {
// }
// void print() {
// cout << i << " " << t << endl;
// }
// };
// int main() {
// Test t0(5);
// t0.print();
// return 0;
// }
// #include<iostream>
// using std::cout;
// using std::endl;
// class Test {
// int i;
// int &ref;
// public:
// Test(): ref(i), i(3) {
// i = 50;
// ref=3;
// }
// void print() {
// cout << i << " " << ref << endl;
// }
// };
// int main() {
// Test t0;
// t0.print();
// return 0;
// }
// class person
// {
// int age;
// public:
// person(int x){age=x;}
// void display(){cout<<"Age="<<age;}
// person olderperson(person p)
// {
// if (age > p.age)
// return *this;
// else
// return p;
// }
// };
// int main()
// {
// person r(35),h(30);
// person o=r.olderperson(h);
// o.display();
// }
class x{
int *p;
public:
x(){
p=int;
*p=10;
}
x(int v){
p=int;
*p=v;
}
int d(void){
return (*p);
}
};
int main(){
x x1;
x x2(2);
x1.d();
x2.d();
}