+ 4

Can you please tell me that what is the meaning of sizeof in c language

16th Apr 2019, 9:04 AM
Yug Bhupesh
Yug Bhupesh - avatar
8 Answers
+ 7
It gives you the size of a variable type in terms of bytes. It is useful when you want to allocate memory through malloc or calloc. It is also a good way of learning about how much memory you use when creating different user-defined variables.
16th Apr 2019, 9:12 AM
Rasmus Bons
Rasmus Bons - avatar
+ 2
I think sizeof() returns a value of type size_t which is pretty much an integer value.
17th Apr 2019, 2:37 AM
Sonic
Sonic - avatar
+ 1
Thanku you !!!!!
16th Apr 2019, 9:26 AM
Yug Bhupesh
Yug Bhupesh - avatar
+ 1
It's a data type seems to return something .....
17th Apr 2019, 5:10 AM
Hari Gopal
Hari Gopal - avatar
+ 1
It shows how much memory required for a particular data type
18th Apr 2019, 4:55 AM
Krishna Priya AS
Krishna Priya AS - avatar
0
No
17th Apr 2019, 11:32 PM
Fried dawg gaming
Fried dawg gaming - avatar
0
it just return us the size of that variable
26th Apr 2019, 6:35 AM
Orisis Gamer
Orisis Gamer - avatar
- 1
int b; cout<<sizeof(b); then answer is 2
26th Apr 2019, 6:36 AM
Orisis Gamer
Orisis Gamer - avatar