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

typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1595


Is main an identifier in c?

1094


What is New modifiers?

1080


What is malloc and calloc?

1015


What is main () in c language?

1088


Write a program to check whether a number is prime or not using c?

1013


What is difference between union All statement and Union?

1066


Explain the difference between malloc() and calloc() function?

995


a value that does not change during program execution a) variabe b) argument c) parameter d) none

1197


What is c system32 taskhostw exe?

987


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

1101


What is difference between Structure and Unions?

1195


how should functions be apportioned among source files?

1070


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

1119


Explain setjmp()?

1020