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

What is a shell structure examples?

1028


 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

2155


Explain can the sizeof operator be used to tell the size of an array passed to a function?

1016


Why array is used in c?

971


explain how do you use macro?

1099


What are identifiers and keywords in c?

1033


Explain why c is faster than c++?

1004


What is signed and unsigned?

1014


Wt are the Buses in C Language

3152


a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.

5000


Explain how do you print an address?

1087


What is a list in c?

983


Is c object oriented?

911


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

2307


Can we change the value of static variable in c?

971