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 is the difference between null pointer and wild pointer?

0 Answers  


Write code for finding depth of tree

2 Answers   Adobe,


Is c pass by value or reference?

0 Answers  


Calculate 1*2*3*____*n using recursive function??

0 Answers  


how to make a scientific calculater ?

0 Answers  


what is a function pointer and how all to declare ,define and implement it ???

4 Answers   Honeywell,


15.what is the disadvantage of using macros? 16.what is the self-referential structure? 17.can a union be self-referenced? 18.What is a pointer? 19.What is the Lvalue and Rvalue? 20.what is the difference between these initializations? 21.Char a[]=”string”; 22.Char *p=”literal”; 23.Does *p++ increment p, or what it points to?

2 Answers   CTS,


what is the code for getting the output as * ** ***

5 Answers   Caritor,


What is the correct code to have following output in c using nested for loop?

0 Answers  


I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...

0 Answers  


3. Program to print all possible substrings. ex: String S St Str Stri Strin String t tr tri trin tring r

3 Answers   Huawei,


Write a Program to print this triangle: * ** * **** * ****** * ******** * ********** use two nested loops.

12 Answers   MIT, TCS,


Categories