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 |
int main(){ float f=8.0; if(f==8.0) printf("good"); else printf("bad"); } what is the answere and explain it?
Where are the auto variables stored?
What is character set?
What is indirection?
wat is the difference between a definition and declaration? float y;---it looks like a declaration..but it s a definition.how?someone explain
what is the differance between pass by reference and pass by value.
can u give me the good and very optimised code for a car racing game?
Write a program to print this triangle: * ** * **** * ****** * ******** * ********** Don't use printf statements;use two nested loops instead. you will have to use braces around the body of the outer loop if it contains multiple statements.
What are the disadvantages of a shell structure?
What is use of bit field?
code for replace tabs with equivalent number of blanks
Explain continue keyword in c