#include<stdio.h>

main()

{

struct xx

{

int x;

struct yy

{

char s;

struct xx *p;

};

struct yy *q;

};

}

Answers were Sorted based on User's Feedback



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

Answer / susie

Answer :

Compiler Error

Explanation:

in the end of nested structure yy a member have to be
declared.

Is This Answer Correct ?    8 Yes 0 No

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

Answer / dayana benny

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 ?    3 Yes 0 No

Post New Answer

More C Code Interview Questions

#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }

1 Answers  


Write a program that find and print how many odd numbers in a binary tree

1 Answers  


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

2 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  


write a c-program to find gcd using recursive functions

5 Answers   HTC, Infotech,






main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); } int i;

1 Answers  


#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

4 Answers   Google, HCL, Quick Heal, WTF,


Given n nodes. Find the number of different structural binary trees that can be formed using the nodes.

16 Answers   Aricent, Cisco, Directi, Qualcomm,


How to access command-line arguments?

4 Answers  


main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }

1 Answers  


main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }

2 Answers   Adobe, CSC,


1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.

3 Answers  


Categories