Here we have sizeof
operator in C
. It is returning the size of datatypes,
printf("%d",sizeof(some datatype));
and result is 4 (OS dependent).
I want to know how it is calculating. what is the logic behind that operator.
If I ask you to write code for sizeof
operator. what will be your answer?
Note : I want to know how sizeof
written as a code so it is capable to calculate size.
As may be I am not able to ask my question properly,I am trying here again.
Write one function which we can use instead of sizeof operator.