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
Can a pointer be null?
What are global variables?
What does c mean before a date?
What is character set?
What is const keyword in c?
What is equivalent to ++i+++j?
What are c header files?
write a program to copy the string using switch case?
Is void a keyword in c?
List some applications of c programming language?
What is wrong with this declaration?
Why clrscr is used in c?
Explain do array subscripts always start with zero?
How can I change the size of the dynamically allocated array?
What is union and structure?