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

Is there any data type in c with variable size?

1093


How to establish connection with oracle database software from c language?

2192


Write a c program to demonstrate character and string constants?

2181


What is the use of define in c?

1053


#include { printf("Hello"); } how compile time affects when we add additional header file .

1884


Explain is it better to bitshift a value than to multiply by 2?

1189


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

3239


How was c created?

1049


Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)

2288


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4676


Where we use clrscr in c?

1127


Is it possible to execute code even after the program exits the main() function?

1328


How can you call a function, given its name as a string?

1152


Explain the advantages of using macro in c language?

992


Explain the priority queues?

1073