Sail E0 Webinar
Question

Which of the following declaration is NOT valid?


#include<stdio.h>
(i) struct A{
int a;
struct B {
int b;
struct B *next;
}tempB;
struct A *next;
}tempA;
(ii) struct B{
int b;
struct B *next;
};
struct A{
int a;
struct B tempB;
struct A *next;
};
(iii)struct B{
int b;
}tempB;
struct {
int a;
struct B *nextB;
};
(iv) struct B {
int b;
struct B {
int b;
struct B *nextB;
}tempB;
struct B *nextB;
}tempB;


Options:
A .  iv only
B .  iii only
C .  All of these
D .  None of these
Answer: Option D

Since all the above structure declarations are valid in C.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers