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

What are the preprocessor categories?

0 Answers  


What is #define used for in c?

0 Answers  


Which of these statements are false w.r.t File Functions? i)fputs() ii)fdopen() iii)fgetpos() iv)ferror() A)ii B)i,ii C)iii D)iv

6 Answers   Accenture,


void main() { int x=25,y=32; clrscr(); x=x++ + y++; y=++x + ++y; printf("%d%d",x,y); }

5 Answers  


Write a program to check whether a number is prime or not using c?

0 Answers  






write a program that will print %d in the output screen??

9 Answers   Infosys,


implement general tree using link list

1 Answers   Wipro,


if function is declared as static in one source file, if I would like to use the same function in some other source file...is it possible....how ?

2 Answers   NetApp,


What are dangling pointers? How are dangling pointers different from memory leaks?

1 Answers  


Why do we use main function?

0 Answers  


where can function pointers be used?

2 Answers  


In a byte, what is the maximum decimal number that you can accommodate?

0 Answers  


Categories