write a program for size of a data type without using
sizeof() operator?
Answer Posted / learner
#include<stdio.h>
void main()
{
char *ptr1,*ptr2;
char fl;//float,double,int
ptr1 = &fl;//it will take the address of f1
ptr2 = (&fl+1);//it wil increment the address with according thr memory size
printf("%u",(char *)ptr2-(char *)ptr1);//explicit type casting for pointers
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is scope of variable in c?
What is cohesion and coupling in c?
can anyone suggest some site name..where i can get some good data structure puzzles???
What is a spanning Tree?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
What are the 5 organizational structures?
Explain about C function prototype?
Write a code to generate a series where the next element is the sum of last k terms.
how to introdu5ce my self in serco
What is the difference between ++a and a++?
can we change the default calling convention in c if yes than how.........?
What is bubble sort in c?
How can I read in an object file and jump to locations in it?
Is main a keyword in c?
What are header files and explain what are its uses in c programming?