-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCODE8.cpp
More file actions
57 lines (43 loc) · 1.85 KB
/
CODE8.cpp
File metadata and controls
57 lines (43 loc) · 1.85 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
#include<iostream>
using namespace std; //<--------------LEARN ABOUT STRUCT UNION AND ENUM
// typedef struct student //<---------------TYPEDEF IS USE TO CONSTRUCT THE (ST)m given below
// {
// /* data */
// int ID;
// float Ratio_n;
// }ST; //<------------USE FOR COMPRESE THE BIG NAME WHICH IS GUVUN UPWORD
typedef union memo
{
/* data */
int M; //|
char N; //|<****************UNION SHARE THE MEMORY BETWEEN ALL OF THREE SO THAT WE WILL PRINT ONLY ONE THINK AT ONE TIME
float T; //
}MO;
int main()
{
// ST hariom;
// hariom.ID = 21; <----------------YES WE CAN WRITE FULL STRUCT STUDENT HARIOM AND SIMPAL STUDENT HAR
// hariom.Ratio_n = 32.56;
// ST yash;
// yash.ID = 22;
// yash.Ratio_n=32.45;
// cout<<"hariom ID is = "<<hariom.ID<<endl;
// cout<<"hariom ID is = "<<hariom.Ratio_n<<endl;
// cout<<"yash ID is = "<<yash.ID<<endl;
// cout<<"yash ID is = "<<yash.Ratio_n<<endl;
// union memo sos;
// sos.N= '3';
// /* sos.M=21;
// sos.T=21.23;
// */
// cout<<sos.N<<endl;
enum name{hariom, yash, sannu };
name sos =hariom;
cout<<sos<<endl;
name sod=yash;
cout<<sod<<endl;
name sof=sannu;
cout<<sof<<endl;
system("pause");
return 0;
}