Skip to content

Commit f277adb

Browse files
committed
structure Declaration updated
1 parent d304b5e commit f277adb

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
struct numbers{
4+
int a;
5+
int b;
6+
}x, y; // sturcture variable declaration can also be done this way
7+
int main()
8+
{
9+
x.a = 10; // intializing structure member of x
10+
x.b = 20;
11+
12+
y = x ; // assigning one structure to another
13+
14+
// printing y structure variable members
15+
16+
cout<<"Structure y Members: "<<endl;
17+
cout<<"A = "<<y.a<<endl;
18+
cout<<"B = "<<y.b<<endl;
19+
return 0;
20+
}
Binary file not shown.

0 commit comments

Comments
 (0)