Find Error if any in below code, Justify ur answer:
struct xx
{
int a;
struct yy
{
char c;
struct xx* p;
}
struct yy* q;
}
Answer Posted / 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 |
Post New Answer View All Answers
simple program of graphics and their output display
What is the value of h?
Explain what is the advantage of a random access file?
What does the error message "DGROUP exceeds 64K" mean?
Why is void main used?
Write a program to print fibonacci series using recursion?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
How pointers are declared?
What is the size of structure pointer in c?
Why doesn't C support function overloading?
What is putchar() function?
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..
What are operators in c?
Write a program to swap two numbers without using a temporary variable?