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 |
write a programe returns the number of times the character appears in the string
An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode
What is main () in c?
Is c call by value?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
What is the difference between fork() and vfork()?
How can you tell whether two strings are the same?
WHO WROTE C LANGUAGE?
what are the advantage of pointer variables? write a program to count the number of vowels and consonants in a given string
What is a C array and illustrate the how is it different from a list.
main() { printf(5+"Vidyarthi Computers"); }
write a program to generate address labels using structures?