What is out put of this program ?
could anyone explain in detail of this code.
#include<stdio.h>
main()
{
struct xx
{
int x;
struct yy
{
char s;
struct xx *p;
};
struct yy *q;
};
}
Administrator • Aug 14, 2012
Member • Aug 14, 2012
actually sir i have tried allot but i am not able to understand..The_Big_K#-Link-Snipped-# : Why not post an analyses on your own first? Ask others to correct you 😀 That'd be a better approach. What say?
Administrator • Aug 14, 2012
Don't worry about being 'right'. Just go step by step and share your thoughts. That'd be a better way to attack such problems. People will appreciate if you put some efforts and share them with us.hare singh nayakactually sir i have tried allot but i am not able to understand..
Member • Aug 17, 2012
hey ... have you compiled this program..... ???? i think it has got some incorrect termination error (i compiled it).... itz not executing..... 😔hare singh nayakhi CEns
could anyone explain in detail of this code.
#include<stdio.h>
main()
{
struct xx
{
int x;
struct yy
{
char s;
struct xx *p;
};
struct yy *q;
};
}
Member • Aug 17, 2012
yea i have compiled this code and there is compilation error but i want to know why compilation error is there and what is wrong in it.Sreejith They ... have you compiled this program..... ???? i think it has got some incorrect termination error (i compiled it).... itz not executing..... 😔
Member • Aug 17, 2012
Member • Aug 18, 2012
hey dude, i think itz a C code 😀David EmperorI want to know, is it a C++ code
if it is
you used a function which doesn't return a parameter
instead of main() you must use void main()
or int main() and before last } write return 0;
Member • Aug 18, 2012
Hey ... i think u have to declare a structure variable for 'struct xx' and have to point the pointer *p to the structure variable of 'xx' structure .... just check : #-Link-Snipped-#hare singh nayakyea i have compiled this code and there is compilation error but i want to know why compilation error is there and what is wrong in it.
Member • Aug 28, 2012
Member • Aug 29, 2012
Hey @ hare singh nayak if we write the above code ashare singh nayakhi CEns
could anyone explain in detail of this code.
#include<stdio.h>
main()
{
struct xx
{
int x;
struct yy
{
char s;
struct xx *p;
};
struct yy *q;
};
}
Member • Aug 31, 2012
Member • Aug 31, 2012
struct xx was not defined at all but used .....what do you mean by defining the struct? Are you telling that the definition must be done globally??
Member • Aug 31, 2012
How about writing a few more statements and check the answer? i mean declare the struct variables, allow 'em to go through several calculations, check whether you got the desired output or not...Banashree PatraHey @ hare singh nayak if we write the above code as
#include<stdio.h>
main()
{
struct xx
{
int x;
struct yy
{
char s;
struct xx *p;
}*q;
};
}
then it is not giving any error,though both are same.