how to find the size of the data type like int,float
without using the sizeof operator?

Answer Posted / abhishek pathak mnnit

#include <stdio.h>
#define sizeof(x) ((void *)(&x + 1) - (void *)(&x))
void main()
{
int a;
printf("int size=%d",sizeof(a));
}

Is This Answer Correct ?    3 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of void pointer?

785


Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014  Npu university

1793


Explain the concept and use of type void.

853


Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop

1909


What is the difference between fread buffer() and fwrite buffer()?

893


What is #define?

781


please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................

1745


Which programming language is best for getting job 2020?

780


What are local variables c?

742


if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.

4813


What is the purpose of macro in C language?

849


What is structure padding and packing in c?

801


Is c is a procedural language?

809


What is the mean of function?

846


A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler

852