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 difference between constant pointer and constant variable?
How to set file pointer to beginning c?
How can I call a function with an argument list built up at run time?
will u please send me the placement papers to my mail???????????????????
What is the explanation for modular programming?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
What is the size of array float a(10)?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
using only #include
What is static and volatile in c?
What are directives in c?
What are the different types of constants?
Is int a keyword in c?
Why doesnt that code work?
Can you think of a logic behind the game minesweeper.