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 / subham singh

1 #include<iostream>
2 using namespace std;
3 main()
4 {
5 int i;
6 int* p = &i;
7 int* q= p;
8 p++;
9 cout<<(char*)p-(char*)q<<endl;
10 }
11
~

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we use int main instead of void main in c?

1156


What is the easiest sorting method to use?

1182


For what purpose null pointer used?

1087


What is the difference between abs() and fabs() functions?

1138


program to convert a integer to string in c language'

2464


What are header files and what are its uses in C programming?

1249


If I have a char * variable pointing to the name of a function ..

1180


Write a code on reverse string and its complexity.

1046


Why is extern used in c?

1100


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

1108


What are the 5 types of inheritance in c ++?

1030


Why is c called a mid-level programming language?

1214


Is exit(status) truly equivalent to returning the same status from main?

1078


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

1157


why programs in c are running with out #include? some warnings are display in terminal but we execute the program we get answer why? eg: main() { printf("hello world "); }

1776