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
#include
What is the difference between union and anonymous union?
How to Throw some light on the splay trees?
What is the use of getchar() function?
What is function prototype in c language?
Who is the main contributor in designing the c language after dennis ritchie?
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
What are the different types of data structures in c?
What is the most efficient way to count the number of bits which are set in an integer?
When should the register modifier be used? Does it really help?
What does c value mean?
how could explain about job profile
Explain 'far' and 'near' pointers in c.
what type of questions arrive in interview over c programming?
What is the purpose of 'register' keyword?