how to find the size of the data type like int,float
without using the sizeof operator?
Answer Posted / sunil
When the parameter is a datatype.
For Eg: sizeof(int), sizeof(double)
#define GetSize(x) (char*)((x*)10 + 1) - (char*)10
When the parameter is a variable.
For Eg: int a;
float b;
sizeof(a), sizeof(b)
#define GetSize(x) (char*)(&x + 1) - (char*)&x
Is This Answer Correct ? | 10 Yes | 4 No |
Post New Answer View All Answers
What is the meaning of 2d in c?
What is the difference between malloc calloc and realloc in c?
How many levels deep can include files be nested?
What is meant by errors and debugging?
Write a program for Overriding.
Can we declare a function inside a function in c?
Explain heap and queue.
Explain how do you convert strings to numbers in c?
Tell us bitwise shift operators?
Why does not c have an exponentiation operator?
How can I find out how much free space is available on disk?
What is a macro?
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
Is c easier than java?
Is the exit() function same as the return statement? Explain.