C Programming :: Typedef

Home > C Programming > Typedef > General Questions

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

1 / 2

 What is output or the error in the program?

#include

typedef int CommVault;
typedef CommVault CommVaultindia;

void main () {
CommVaultindia val= 234;
printf("%d ", val);
}

ACompilation error: typedef cannot be outside a function scope

BCompilation error: undefined variable val

C234

DCompilation error: cannot typedef based on another typedef

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
0
Solv. Corr.
0
Solv. In. Corr.
0
Attempted
0 M:0 S
Avg. Time

2 / 2

 The declarations

typedef float hight [100];
height men, women;

Adefine men and women as 100 element floating point arrays

Bdefine men and women as floating point variables

Cdefine height, men and women as floating point variables

DAre illegal

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace