struct node
{
int *a;
char *b;
char array[12];
};
struct node m,*n;
assign the value in *a,*b,char array[12]
Answer Posted / varun
m.a=(int*)malloc(4);
*(m.a)=2;
m.b=(char*)malloc(10);
m.b="hello";
strcpy(m.array,"world");
n=(struct node*)malloc(sizeof(struct node));
n->a=(int*)malloc(4);
*(n->a)=2;
n->b=(char*)malloc(10);
n->b="hello";
strcpy(n->array,"world");
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Tell me can the size of an array be declared at runtime?
What are register variables? What are the advantage of using register variables?
write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.
What is atoi and atof in c?
What are the salient features of c languages?
What are different storage class specifiers in c?
What are shell structures used for?
Why doesnt the call scanf work?
Is it fine to write void main () or main () in c?
What are local static variables? How can you use them?
What are the types of variables in c?
What are linked lists in c?
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
What is indirection?