Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

simple program of graphics and their output display

2048


What is the value of h?

1085


Explain what is the advantage of a random access file?

1175


What does the error message "DGROUP exceeds 64K" mean?

1276


Why is void main used?

1145


Write a program to print fibonacci series using recursion?

1131


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

16918


How pointers are declared?

1009


What is the size of structure pointer in c?

1115


Why doesn't C support function overloading?

2866


What is putchar() function?

1219


find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

2049


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1958


What are operators in c?

1077


Write a program to swap two numbers without using a temporary variable?

1179