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
Why is this loop always executing once?
What is the purpose of 'register' keyword?
What is sizeof int in c?
Is fortran still used in 2018?
Is null a keyword in c?
What is c language & why it is used?
How is a null pointer different from a dangling pointer?
What is null pointer in c?
Is c weakly typed?
What language is lisp written in?
using for loop sum 2 number of any 4 digit number in c language
How can you return multiple values from a function?
How can I manipulate strings of multibyte characters?
Explain the difference between malloc() and calloc() function?
Explain what is a stream?