-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut14.cpp
More file actions
64 lines (52 loc) · 1.36 KB
/
tut14.cpp
File metadata and controls
64 lines (52 loc) · 1.36 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
// # include <iostream>
// using namespace std;
// typedef struct employee
// {
// int id ;
// char favchar ;
// float salary ;
// }pr;
// int main()
// {
// struct employee yash ;
// yash.id = 21 ;
// yash.favchar = 'p';
// yash.salary = 89000 ;
// cout<<yash.id<<endl;
// cout<<yash.favchar<<endl;
// cout<<yash.salary<<endl;
// // You can use "typedef" keyword to short the name of the stuct employee you
// // can write ep or any thing
// pr pratham;
// pratham.id = 90 ;
// pratham.favchar = 'i' ;
// pratham.salary = 3443433 ;
// cout<<pratham.id<<endl;
// cout<<pratham.favchar<<endl;
// cout<<pratham.salary<<endl;
// }
// *********************** UNION *********************
/* union is best way to allocate memory but you can use only one at a time
which is require */
// union money {
// int rice;
// char car ;
// float pounds ;
// };
// int main()
// {
// union money yash ;
// yash.car = 'c';//you can use only one value other wise it provide garbage value
// cout<<yash.car;
// }
// *************************** ENUMS ************************
// int main()
// {
// enum meal { breakfast,lunch,dinner };
// cout<<breakfast<<endl;
// cout<<lunch<<endl;
// cout<<dinner<<endl;
// meal m1 = lunch ;
// cout<<m1 ;
// return 0 ;
// }