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
How can I implement sets or arrays of bits?
What is dynamic dispatch in c++?
Explain union.
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
How can I handle floating-point exceptions gracefully?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
Write a program to show the change in position of a cursor using c
i have a written test for microland please give me test pattern
What is meant by int main ()?
What are the different data types in C?
What is the use of linkage in c language?
Is it valid to address one element beyond the end of an array?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
In a header file whether functions are declared or defined?
What does double pointer mean in c?