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

about c language

0 Answers  


how to find a 5th bit is set in c program

4 Answers   IBM,


What is the output of below code? main() { static int a=5; printf("%3d",a--); if(a) main(); }

1 Answers  


what is the output of printf("%d",(scanf("%d",10));

10 Answers  


What is c method?

0 Answers  






Why does everyone say not to use gets?

0 Answers  


which will be first in c compiling ,linking or compiling ,debugging.

3 Answers   Sonata,


How can I do graphics in c?

0 Answers  


c program to subtract between two numbers without using '-' sign and subtract function.

2 Answers  


Difference between for loop and while loop?

1 Answers  


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

0 Answers  


How can I open files mentioned on the command line, and parse option flags?

0 Answers  


Categories