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


Please Help Members By Posting Answers For Below Questions

Is return a keyword in c?

832


What are comments and how do you insert it in a C program?

977


Explain what is the difference between functions getch() and getche()?

796


Who developed c language and when?

824


What does c mean?

772


What is main () in c language?

846


What is hashing in c?

897


What is a null pointer in c?

838


What are the 5 elements of structure?

818


What is ponter?

1024


What is volatile, register definition in C

897


What are the disadvantages of external storage class?

805


How can I run c program?

936


What is static identifier?

915


Explain what is output redirection?

888