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 / g

This code will work in TC with 2 warnings but can get result

void main()
{
char *Ptr1,*Ptr2;
float fl;
ptr1 = &fl;
ptr2 = (&fl+1);

printf("%u",ptr2-ptr1);
}

This is a way to get the size of data type...waiting for
any other way...

Is This Answer Correct ?    44 Yes 26 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the bubble sort algorithm.

1004


How can you be sure that a program follows the ANSI C standard?

1560


Do you have any idea how to compare array with pointer in c?

991


How do you initialize pointer variables?

1031


Explain what is the difference between a free-standing and a hosted environment?

1126


Can you write a programmer for FACTORIAL using recursion?

985


What is the maximum length of an identifier?

1135


Explain modulus operator.

999


If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above

999


Explain the use of bit fieild.

1097


Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?

1074


How can I convert a number to a string?

1095


What is pass by reference in functions?

771


write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3

2030


What is call by reference in functions?

1320