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

#include <stdio.h>

int main()
{
float a[2];

int size = (char*)&a[1] - (char*)&a[0];

printf("%d
",size);
return 0;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is advantage of pointer in c?

1122


What is merge sort in c?

1002


Explain data types & how many data types supported by c?

1024


What is wrong in this statement? scanf(ā€œ%dā€,whatnumber);

1190


a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor

1034


What is wild pointer in c?

1018


How was c created?

997


What are formal parameters?

1070


Is it better to bitshift a value than to multiply by 2?

1050


Tell me when would you use a pointer to a function?

1011


Is c still used?

999


What are the application of void data type in c?

1133


What is a ternary operator in c?

1058


Can a function argument have default value?

1092


How can I access an I o board directly?

1037