-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtut14.cpp
70 lines (55 loc) · 1.66 KB
/
tut14.cpp
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
#include<iostream>
using namespace std;
void name(){
cout<<"Author: Varun Gupta"<<endl;
}
int main(){
name();
//Using typedef //typedef can change the name of any data type.
// typedef struct employee
// {
// long int no;
// char name;
// float salary;
// }ep;
// struct employee
// {
// long int no;
// char name;
// float salary;
// };
// //Structure
// ep kartik;
// kartik.no = 88888;
// kartik.name='d';
// kartik.salary= 11234.88;
// struct employee kartik;
// kartik.no = 999999;
// kartik.name='b';
// kartik.salary= 17989.99;
// cout<<"The number is :"<<kartik.no<<endl;
// cout<<"The name is :"<<kartik.name<<endl;
// cout<<"The salary is :"<<kartik.salary<<endl;
//Union
// union house
// {
// int expenses;
// char name;
// float ration;
// /* data */
// };
// union house h1;
// h1.expenses=34;
// // h1.ration=34.43;
// h1.name='b';
// cout<<h1.name<<endl;
//Enum
enum meal{breakfast,lunch,dinner};
meal m1=breakfast;
meal m2= lunch;
meal m3= dinner;
cout<<"The value is:"<<m1<<endl;
cout<<"The value is:"<<m2<<endl;
cout<<"The value is:"<<m3<<endl;
return 0;
}