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 'bus error'?
Why c is a mother language?
What is class and object in c?
How can I remove the leading spaces from a string?
Write a factorial program using C.
What is data structure in c language?
Why is c used in embedded systems?
Write a code on reverse string and its complexity.
What is advantage of pointer in c?
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
What is s in c?
Can we replace the struct function in tree syntax with a union?
What is data type long in c?
What type is sizeof?
general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only