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

What is a file descriptor in c?

1123


What is d'n in c?

1117


Is null always defined as 0(zero)?

1098


What is the best style for code layout in c?

1092


hi folks i m approching for h1 b interview on monday 8th of august at montreal and i m having little problem in my approval notice abt my bithdate my employer has made a mistake while applying it is 12th january and istead of that he had done 18 the of january do any body have any solution for that if yes how can i prove my visa officer abt my real birthdate it urgent please let me know guys thaks dipesh patel

1874


hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

1913


what is a function method?give example?

2355


An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

1228


What is a example of a variable?

1009


Can we replace the struct function in tree syntax with a union?

1302


What is define directive?

1138


What are the benefits of organizational structure?

1016


What is an endless loop?

1269


write a program to display all prime numbers

1956


What is the meaning of typedef struct in c?

1063