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
What is a file descriptor in c?
What is d'n in c?
Is null always defined as 0(zero)?
What is the best style for code layout in c?
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
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
what is a function method?give example?
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?
What is a example of a variable?
Can we replace the struct function in tree syntax with a union?
What is define directive?
What are the benefits of organizational structure?
What is an endless loop?
write a program to display all prime numbers
What is the meaning of typedef struct in c?