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 indirection? How many levels of pointers can you have?

659


How do you print only part of a string?

615


Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?

2173


Explain the difference between malloc() and calloc() function?

602


What is the purpose of 'register' keyword in c language?

629






What is the difference between malloc() and calloc()?

617


What is calloc malloc realloc in c?

594


What are linked lists in c?

651


Why shouldn’t I start variable names with underscores?

625


Which header file is used for clrscr?

582


What is volatile variable in c with example?

588


Define recursion in c.

702


How many types of operators are there in c?

616


How will you find a duplicate number in a array without negating the nos ?

1648


Did c have any year 2000 problems?

657