#include<stdio.h>

main()

{

struct xx

{

int x;

struct yy

{

char s;

struct xx *p;

};

struct yy *q;

};

}



#include<stdio.h> main() { struct xx { int x; ..

Answer / susie

Answer :

Compiler Error

Explanation:

The structure yy is nested within structure xx.
Hence, the elements are of yy are to be accessed through the
instance of structure xx, which needs an instance of yy to
be known. If the instance is created after defining the
structure the compiler will not know about the instance
relative to xx. Hence for nested structure yy you have to
declare member.

Is This Answer Correct ?    4 Yes 3 No

Post New Answer

More C Code Interview Questions

main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above

3 Answers   HCL,


main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }

1 Answers  


int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too

1 Answers  


Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.

2 Answers   Mentor Graphics, Microsoft,


#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }

2 Answers  






write a program to count the number the same (letter/character foreg: 's') in a given sentence.

2 Answers  


Sorting entire link list using selection sort and insertion sort and calculating their time complexity

1 Answers   Infosys, Microsoft, NetApp,


main() { float f=5,g=10; enum{i=10,j=20,k=50}; printf("%d\n",++k); printf("%f\n",f<<2); printf("%lf\n",f%g); printf("%lf\n",fmod(f,g)); }

1 Answers  


#define a 10 void foo() { #undef a #define a 50 } int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } explain the answer

1 Answers  


void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }

1 Answers  


Which one is taking more time and why ? :/home/amaresh/Testing# cat time.c //#include <stdio.h> #define EOF -1 int main() { register int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } ------------------- WIth stdio.h:- :/home/amaresh/Testing# time ./time_header hi hi hru? hru? real 0 m4.202s user 0 m0.000s sys 0 m0.004s ------------------ Witout stdio.h and with #define EOF -1 =================== /home/amaresh/Testing# time ./time_EOF hi hi hru? hru? real 0 m4.805s user 0 m0.004s sys 0 m0.004s -- From above two case , why 2nd case is taking more time ?

0 Answers  


#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }

3 Answers  


Categories