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 malloc and calloc?
What is zero based addressing?
Why are all header files not declared in every c program?
What is a structure in c language. how to initialise a structure in c?
Tell us bitwise shift operators?
Why void main is used in c?
What are predefined functions in c?
What is the meaning of ?
Difference between pass by reference and pass by value?
Are there namespaces in c?
explain what is a newline escape sequence?
What are near, far and huge pointers?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
can anyone suggest some site name..where i can get some good data structure puzzles???
Describe the header file and its usage in c programming?