Is the following code legal?
struct a
{
int x;
struct a b;
}

Answers were Sorted based on User's Feedback



Is the following code legal? struct a { int x; struct a b; } ..

Answer / raghu

no this code is illegal.

legal one:

struct a
{
int x;
struct a *b;
}

Is This Answer Correct ?    26 Yes 7 No

Is the following code legal? struct a { int x; struct a b; } ..

Answer / siva

This code is illegal.

Is This Answer Correct ?    10 Yes 2 No

Is the following code legal? struct a { int x; struct a b; } ..

Answer / preeti

no. It is illegal ..
Struct shd be ended by a semi colon ..

struct a
{
int x;
struct a b;
};

Is This Answer Correct ?    8 Yes 2 No

Is the following code legal? struct a { int x; struct a b; } ..

Answer / dilpreet

yes, it is nested structure

Is This Answer Correct ?    6 Yes 5 No

Post New Answer

More C Interview Questions

Explain what is the most efficient way to store flag values?

0 Answers  


what is the diff b/w static and non static variables in C. Give some examples plz.

3 Answers   Wipro,


Why do we use stdio h and conio h?

0 Answers  


What is a macro, and explain how do you use it?

0 Answers  


what is the difference between. system call and library function?

2 Answers   CDAC, Satyam,






Why & is used in c?

0 Answers  


x=2,y=6,z=6 x=y==z; printf(%d",x)

13 Answers   Bharat, Cisco, HCL, TCS,


void main() { int a=1; while(a++<=1) while(a++<=2); }

4 Answers   HCL,


what is the difference between procedure oriented and object oriented progaming language

1 Answers  


How can I find out the size of a file, prior to reading it in?

0 Answers  


Multiply an Integer Number by 2 Without Using Multiplication Operator

0 Answers  


Is that possible to store 32768 in an int data type variable?

0 Answers  


Categories