Structure And Union - Study Mode
[#91] What will be the output of the following C code? #include <stdio.h>
struct student
{
char a[]
}
void main()
{
struct student s
printf("%d", sizeof(struct student))
}
Correct Answer
(A) Compile time error
[#92] Which function is responsible for searching in the table? (For #define IN 1, the name IN and replacement text 1 are stored in a "table")
Correct Answer
(B) lookup(s)
[#93] Which is the correct syntax to use typedef for struct?
Correct Answer
(D) All of the mentioned
[#94] What will be the output of the following C code? #include <stdio.h>
struct point
{
int x
int y
}
struct notpoint
{
int x
int y
}
struct point foo()
int main()
{
struct point p = {1}
struct notpoint p1 = {2, 3}
p1 = foo()
printf("%d
", p1.x)
}
struct point foo()
{
struct point temp = {1, 2}
return temp
}
Correct Answer
(A) Compile time error
[#95] What will be the output of the following C code? #include <stdio.h>
struct student
{
char *name
}
void main()
{
struct student s[2], r[2]
s[1] = s[0] = "alan"
printf("%s%s", s[0].name, s[1].name)
}
Correct Answer
(C) Compile time error