Find Error if any in below code, Justify ur answer:
struct xx
{
int a;
struct yy
{
char c;
struct xx* p;
}
struct yy* q;
}
Answers were Sorted based on User's Feedback
Answer / vignesh1988i
here the error is the variable declaration of struct xx is not permitted inside struct yy. since this is nested structures ,so according to the braces for each structures the variables for that particular structure should be assigned (OR)
if this is written as code given below this will be correct.
THIS IS THE CORRECT CODE WHICH WILL GIVE NO ERROR.
struct xx
{
int a;
}
struct yy
{
char c;
struct xx *p;
}
struct yy *q
THE SAME CODE GIVEN IN THE QUESTION CAN BE CORRECTED AS :
struct xx
{
int a;
struct yy
{
char c;
}*q // for struct yy
}*p // for struct xx
thank u
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / raj
struct xx
{
int a;
struct yy
{
char c;
struct xx* p;
};//Semicolon is missing
struct yy* q;
}
| Is This Answer Correct ? | 0 Yes | 4 No |
What is your favorite subject?
1 Answers Ericsson, Invendis, Tech Mahindra,
wat are the two methods for swapping two numbers without using temp variable??
write a program to convert a expression in polish notation (postfix) to inline (normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix
helllo sir give me some information of the basic information the c as printf ,scanf , %d ,%f and why is the main use of these.
union { char ch[10]; short s; }test; test.s = 0xabcd; main() { printf("%d",ch[10]); }
Write a program that his output 1 12 123
What is the equivalent code of the following statement in WHILE LOOP format?
How can I list all of the predefined identifiers?
What is a char c?
write a program for odd numbers?
Explain union.
What is quick sort in c?