how to find the size of the data type like int,float
without using the sizeof operator?
Answer Posted / ravi.jnv
Its possible by pointers.
-----------------
int one,two;
int *ptrOfOne,*ptrOfTwo;
int size;
ptrOfOne = &one;
ptrOfTwo = &two;
size = ptrOfOne - ptrOfTwo ; /* u can get minus value also
depending upon stack how it pushes variables */
| Is This Answer Correct ? | 6 Yes | 28 No |
Post New Answer View All Answers
How important is structure in life?
What is atoi and atof in c?
What is the use of header?
What is null pointer constant?
If errno contains a nonzero number, is there an error?
How can I handle floating-point exceptions gracefully?
Write a program to show the change in position of a cursor using c
What is this pointer in c plus plus?
What is operator precedence?
What's the difference between constant char *p and char * constant p?
Not all reserved words are written in lowercase. TRUE or FALSE?
how to write optimum code to divide a 50 digit number with a 25 digit number??
What is assignment operator?
Why c is called top down?
Why is c so powerful?