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
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
Is main an identifier in c?
What is New modifiers?
What is malloc and calloc?
What is main () in c language?
Write a program to check whether a number is prime or not using c?
What is difference between union All statement and Union?
Explain the difference between malloc() and calloc() function?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
What is c system32 taskhostw exe?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
What is difference between Structure and Unions?
how should functions be apportioned among source files?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
Explain setjmp()?