-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathSizeS.c
45 lines (35 loc) · 979 Bytes
/
SizeS.c
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
/**********************************************************
Statement - Calculate Size of Structure
Programmer - Vineet Choudhary
Written For - https://developerinsider.co
**********************************************************/
#include<stdio.h>
struct stud {
int roll;
char name[10];
int marks;
};
int main() {
int size;
struct stud s;
size = sizeof(s);
printf("nSize of Structure : %d", size);
return(0);
}
/*
Explanation :
---------------
Structure is Collection of elements of the Different data Types.
Size of the Structure Can be Evaluated using “sizeof Operator”
size = sizeof(s);
Formula for Calculating Size of Structure :
-------------------------------------------
Size of Structure 'S' = sizeof(roll) + sizeof(name) + sizeof(mark)
= 2 + 10 + 2
= 14
->Size depends on your computer
Remember :
----------
sizeof is Operator not function
sizeof Operator Takes any Variable as Parameter.
*/