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...

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


Please Help Members By Posting Answers For Below Questions

Why array is used in c?

979


Explain what happens if you free a pointer twice?

1037


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

2846


Which is better oop or procedural?

1006


how many key words availabel in c a) 28 b) 31 c) 32

1022


What is #include stdio h?

1073


Is c still relevant?

1047


Define the scope of static variables.

1078


Explain what are the different data types in c?

1183


What are the 5 types of inheritance in c ++?

983


Explain argument and its types.

1011


Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

1064


write a program for the normal snake games find in most of the mobiles.

2225


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

2793


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1877