Is the following code legal?

typedef struct a

{

int x;

aType *b;

}aType



Is the following code legal? typedef struct a { int x; aTy..

Answer / susie

Answer :

No

Explanation:

The typename aType is not known at the point of declaring
the structure (forward references are not made for typedefs).

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Code Interview Questions

main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }

1 Answers  


void main() { unsigned giveit=-1; int gotit; printf("%u ",++giveit); printf("%u \n",gotit=--giveit); }

1 Answers  


main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }

1 Answers  


#include<stdio.h> #include<conio.h> void main() { int a=(1,2,3,(1,2,3,4); switch(a) { printf("ans:"); case 1: printf("1");break; case 2: printf("2");break; case 3: printf("1");break; case 4: printf("4");break; printf("end"); } getch(); }

0 Answers  


How we print the table of 3 using for loop in c programing?

7 Answers  






what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }

3 Answers   Wipro,


main() { int c=- -2; printf("c=%d",c); }

1 Answers   TCS,


#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

2 Answers  


what is variable length argument list?

2 Answers  


main() { char not; not=!2; printf("%d",not); }

1 Answers  


Write a routine to implement the polymarker function

0 Answers   TCS,


main() { float i=1.5; switch(i) { case 1: printf("1"); case 2: printf("2"); default : printf("0"); } }

2 Answers  


Categories