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
Is return a keyword in c?
What are comments and how do you insert it in a C program?
Explain what is the difference between functions getch() and getche()?
Who developed c language and when?
What does c mean?
What is main () in c language?
What is hashing in c?
What is a null pointer in c?
What are the 5 elements of structure?
What is ponter?
What is volatile, register definition in C
What are the disadvantages of external storage class?
How can I run c program?
What is static identifier?
Explain what is output redirection?