Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
80 lines (69 loc) · 1.62 KB

File metadata and controls

80 lines (69 loc) · 1.62 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#include<iostream>
#include<vector>
#include<string>
#include<list>
using namespace std;
// class data
// {
// public:
// string name, address, carN, carM, date;
// void get()
// {
// cin.ignore();
// getline(cin,name);
// getline(cin,address);
// getline(cin,carN);
// getline(cin,carM);
// getline(cin,date);
// }
// void put()
// {
// cout << "Name: " << name << endl;
// cout << "Address: " << address << endl;
// cout << "Car Name: " << carN << endl;
// cout << "Car Model: " << carM << endl;
// cout << "Date: " << date << endl;
// }
// };
// void sameCar(vector<data*> objs,int n)
// {
// cout << "Same car in same year employees: " << endl;
// for(int i=0;i<n;i++)
// for(int j=0;j<n;j++)
// if(objs[j]->carN==objs[i]->carN && objs[i]->date==objs[j]->date && i!=j)
// cout << "Name: " << objs[j]->name << endl;
// }
// int main()
// {
// vector<data*> arr;
// int n;
// cin >> n;
// for(int i=0;i<n;i++)
// arr.push_back(new data);
// for(int i=0;i<n;i++)
// arr.at(i)->get();
// for(int i=0;i<n;i++)
// arr.at(i)->put();
// sameCar(arr,n);
// return 0;
// }
class Student
{
public:
int roll;
string name;
};
int main(){
vector <Student> l2;
Student obj1,obj2;
l2.push_back(obj1);
l2.push_back(obj2);
l2[0].roll = 1243;
l2[1].roll = 243;
l2[0].name = "sdhjf";
l2[1].name = "sdjfkh";
for(int i=0;i<2;i++){
cout << l2[i].roll << l2[i].name << endl;
}
return 0;
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.