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 / mukesh kumar singh

#include <iostream>
using namespace std;
struct node {
int x;
int y;
char *s;
};
int main()
{


node x,*p;/* here u can change the type */

p=&x;
cout<<"\n\nSize of node Is : "<<(char*)(p+1)-(char*)p;
return 0;
}

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

#include int main(){ int i=10; int *ptr=&i; *ptr=(int *)20; printf("%d",i); return 0; } Output: 20 can anyone explain how came the output is 20

1676


What is the difference between union and anonymous union?

1246


How to Throw some light on the splay trees?

998


What is the use of getchar() function?

1070


What is function prototype in c language?

981


Who is the main contributor in designing the c language after dennis ritchie?

950


A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

1112


What are the different types of data structures in c?

1106


What is the most efficient way to count the number of bits which are set in an integer?

999


When should the register modifier be used? Does it really help?

916


What does c value mean?

1109


how could explain about job profile

1856


Explain 'far' and 'near' pointers in c.

1078


what type of questions arrive in interview over c programming?

1976


What is the purpose of 'register' keyword?

1046