Is the following code legal?

typedef struct a aType;

struct a

{

int x;

aType *b;

};



Is the following code legal? typedef struct a aType; struct a { ..

Answer / susie

Answer :

Yes

Explanation:

The typename aType is known at the point of declaring the
structure, because it is already typedefined.

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More C Code Interview Questions

In the following pgm add a stmt in the function fun such that the address of 'a' gets stored in 'j'. main(){ int * j; void fun(int **); fun(&j); } void fun(int **k) { int a =0; /* add a stmt here*/ }

1 Answers  


program to find the roots of a quadratic equation

14 Answers   College School Exams Tests, Engineering, HP, IIIT, Infosys, Rajiv Gandhi University of Knowledge Technologies RGUKT, SSC,


main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }

2 Answers   CSS, Wipro,


main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?

2 Answers  


1 o 1 1 0 1 0 1 0 1 1 0 1 0 1 how to design this function format in c-language ?

2 Answers  






main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } a. Runtime error. b. 0, 0 c. Compile error d. the first two values entered by the user

2 Answers   HCL,


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

0 Answers  


void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }

1 Answers  


Who could write how to find a prime number in dynamic array?

1 Answers  


#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }

1 Answers  


#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above

3 Answers   HCL,


main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }

2 Answers  


Categories