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

Explain what is the benefit of using #define to declare a constant?

1189


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

2077


Are pointers integers in c?

1075


How are Structure passing and returning implemented by the complier?

1169


What is a string?

1119


What is enumerated data type in c?

1082


What are the types of macro formats?

1124


What is advantage of pointer in c?

1189


What does it mean when the linker says that _end is undefined?

1098


What is difference between arrays and pointers?

1075


Write a program to check armstrong number in c?

1132


What is mean by data types in c?

1032


What is wrong in this statement?

1145


What are multibyte characters?

1120


What is typedef struct in c?

1050