struct node
{
int *a;
char *b;
char array[12];
};
struct node m,*n;
assign the value in *a,*b,char array[12]
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / aravind
struct node
{
int *a;
char *b;
char array[12];
};
struct node m,*n;
m->a*=5;
m->*b='c';
m.array[12]={"aravind");
| Is This Answer Correct ? | 1 Yes | 2 No |
/* hello i am ricky dobriyal */
struct node
{
int *a;
char *b;
char array[12];
};
struct node m,*n;
n->a=10;
n->b='5';
m.array="ricky dobriyal";
| Is This Answer Correct ? | 0 Yes | 2 No |
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
What is wrong with this code?
can you explain in brief what is "r+" mode in a file... i know that it si used to read and modify rhe existing content.... but explalanation about the file pointer in "r+" mode i wann to know???????????
How can you determine the size of an allocated portion of memory?
What is the use of a semicolon (;) at the end of every program statement?
WAP to convert text into its ASCII Code and also write a function to decode the text given?
What are the phases in s/w developed life cycle? wat is the diff b/w stack & queue...where do we use stack
1)what is the error in the following stmt where str is a char array and the stmt is supposed to traverse through the whole character string str? for(i=0;str[i];i++) a)There is no error. b)There shud be no ; after the stmt. c)The cond shud be str[i]!='\0' d)The cond shud be str[i]!=NULL e)i shud be initialized to 1
how does the for loop work actually..suppose for the following program how it ll work plz explain to me for(i=5;i>=0;i--) prinf(i--);
What is the deal on sprintf_s return value?
Why can’t we compare structures?
44.what is the difference between strcpy() and memcpy() function? 45.what is output of the following statetment? 46.Printf(“%x”, -1<<4); ? 47.will the program compile? int i; scanf(“%d”,i); printf(“%d”,i); 48.write a string copy function routine? 49.swap two integer variables without using a third temporary variable? 50.how do you redirect stdout value from a program to a file? 51.write a program that finds the factorial of a number using recursion?