Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

Is the following code legal?

void main()


typedef struct a aType;

aType someVariable;

struct a


int x;

aType *b;



Is the following code legal? void main() { typedef struct a aType; aTy..

Answer / susie

Answer :



When the declaration,

typedef struct a aType;

is encountered body of struct a is not known. This is known
as ‘incomplete types’.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C Code Interview Questions

why java is platform independent?

13 Answers   Wipro,

main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }

3 Answers   GNITC,

#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  

Write a program using one dimensional array to assign values and then display it on the screen. Use the formula a[i]=i*10 to assign value to an element.

1 Answers   Samar State University,

How do you sort a Linked List (singly connected) in O(n) please mail to if u can find an anser...i m desperate to knw...

6 Answers   Microsoft, MSD, Oracle,

enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }

2 Answers  

main() { printf("\nab"); printf("\bsi"); printf("\rha"); }

3 Answers  

#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a * ++a * ++a; printf("post=%d pre=%d",post,pre); return 0; }

3 Answers  

Write a program to receive an integer and find its octal equivalent?

7 Answers  

What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

1 Answers  

what is the output of the below program & why ? #include<stdio.h> void main() { int a=10,b=20,c=30; printf("%d",scanf("%d%d%d",&a,&b,&c)); }

6 Answers   CSC, IIIT,

Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.

2 Answers