Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Why is this loop always executing once?

1110


What is the purpose of 'register' keyword?

1134


What is sizeof int in c?

1114


Is fortran still used in 2018?

1094


Is null a keyword in c?

1252


What is c language & why it is used?

1175


How is a null pointer different from a dangling pointer?

1086


What is null pointer in c?

1044


Is c weakly typed?

1075


What language is lisp written in?

1325


using for loop sum 2 number of any 4 digit number in c language

2418


How can you return multiple values from a function?

1168


How can I manipulate strings of multibyte characters?

1158


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

1102


Explain what is a stream?

1145