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

#include <stdio.h>
int main(){
printf("%d\n",((int*)0 + 1));
}

We can replace int with any other type
(Built-in/user-defined ) to get the size.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between %d and %i?

1092


How is null defined in c?

1151


What is the difference between the = symbol and == symbol?

1110


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

1601


What is the purpose of 'register' keyword in c language?

1022


Explain what does a function declared as pascal do differently?

1277


Are the expressions * ptr ++ and ++ * ptr same?

1145


Why pointers are used in c?

1006


What is pass by reference in c?

1186


What is the difference between array and linked list in c?

1148


How can you pass an array to a function by value?

1116


how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

1086


What is the use of structure padding in c?

1057


Can a void pointer point to a function?

1020


What are the advantages and disadvantages of pointers?

1070