-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstruct.c
More file actions
59 lines (45 loc) · 1.35 KB
/
Copy pathstruct.c
File metadata and controls
59 lines (45 loc) · 1.35 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
// #include<stdio.h>
// struct student
// {
// int roll;
// char name[20];
// float marks;
// }student1 = {10,"Balkumar",99.5},student2 = {20,"Vishwakarma",65.6};
// int main()
// {
// printf("Student Data...\n");
// printf("roll - %d %d\n",student1.roll,(&student1)->roll);
// printf("name - %s %s\n",student1.name,(&student1)->name);
// printf("marks- %f %f\n",student1.marks,(&student1)->marks);
// printf("student data...\n");
// printf("roll - %d %d\n",student2.roll,(&student2)->roll);
// printf("name - %s %s\n",student2.name,(&student2)->name);
// printf("marks - %f %f\n",student2.marks,(&student2)->marks);
// }
// #include<stdio.h>
// int main()
// {
// struct st
// {
// int number;
// char name;
// float percent;
// };
// struct st s;
// printf("Enter the structure data 1)int 2)char 3)float\n");
// scanf("%d %c%f",&s.number,&s.name,&s.percent);
// printf("x - %d ch - %c f - %f\n",s.number,s.name,s.percent);
// }
// checking of sizeof declaration data
#include <stdio.h>
#include <string.h>
struct Data {
int i;
float f;
char str[20];
};
int main( ) {
struct Data data;
printf( "Memory size occupied by data : %d\n", sizeof(data));
return 0;
}