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 benefit of using #define to declare a constant?

1056


What is the concatenation operator?

1094


write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.

2046


What library is sizeof in c?

1046


application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above

1021


How do you define a function?

980


in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

1043


What is the size of array float a(10)?

1098


Why header files are used?

1080


What are the different types of C instructions?

1259


What is an example of structure?

988


Why functions are used in c?

1083


Write a program to print all permutations of a given string.

1142


What is use of #include in c?

1108


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

989