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

Can U write a C-program to print the size of a data type
without using the sizeof() operator? Explain how it works
inside ?

Answer Posted / rajesh

#include<stdio.h>
int main()
{
int p;

printf("%d\n",(char*)(&p+1)-(char*)(&p));
return 0;
}

Is This Answer Correct ?    8 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how do you determine whether to use a stream function or a low-level function?

1135


What are the 5 data types?

1211


Do string constants represent numerical values?

1449


Explain what is the use of a semicolon (;) at the end of every program statement?

1262


Which function in C can be used to append a string to another string?

1274


What are the types of data files?

1252


Write a program to swap two numbers without using third variable in c?

1181


How does placing some code lines between the comment symbol help in debugging the code?

1064


What is the benefit of using #define to declare a constant?

1150


What is the return type of sizeof?

1114


Under what circumstances does a name clash occur?

1275


What is wrong with this statement? Myname = 'robin';

1393


What will be your course of action for a push operation?

1155


Can one function call another?

1174


Is it better to use a macro or a function?

1206