C Programming - Typedefs
Question 1
|
What is the output of this C code?
Compile time error
| |
Varies
| |
hi
| |
h
|
Question 2
|
What is the output of this C code?
Compile time error
| |
Varies
| |
he
| |
hey
|
Question 3
|
What is the output of this C code?
Compile time error
| |
Undefined behaviour
| |
Depends on the standard
| |
10
|
Question 4
|
What is the output of this C code?
Compile time error
| |
Nothing
| |
Undefined behaviour
| |
Depends on the standard
|
Question 5
|
What is the output of this C code?
Compile time error
| |
Nothing
| |
Undefined behaviour
| |
Depends on the standard
|
Question 6
|
What is the output of this C code?
Compile time error
| |
1
| |
0
| |
Depends on the standard
|
Question 7
|
What is the output of this C code?
Compile time error
| |
1
| |
0
| |
Depends on the standard
|
Question 8
|
What is the output of this C code?
Compile time error
| |
1
| |
0
| |
Depends on the standard
|
Question 9
|
The correct syntax to use typedef for struct is.
typedef struct temp { int a; }TEMP;
| |
typedef struct { int a; }TEMP;
| |
struct temp { int a; }; typedef struct temp TEMP;
| |
All of the mentioned
|
Question 10
|
For the following expression to work, which option should be selected. string p = “HELLO”;
typedef char [] string;
| |
typedef char *string;
| |
Both (a) and (b)
| |
Such expression cannot be generated in C
|
Question 11
|
Which of the given option is the correct method for initialization? typedef char *string;
*string *p = “Hello”;
| |
string p = “Hello”;
| |
*string p = ‘A’;
| |
Not more than one space should be given when using typedef
|
Question 12
|
Which of the following is FALSE about typedef?
typedef follow scope rules
| |
typedef defined substitutes can be redefined again. (Eg: typedef char a; typedef int a;)
| |
You cannot typedef a typedef with other term.
| |
All of the mentioned
|
Question 13
|
typedef which of the following may create problem in the program
;
| |
printf/scanf
| |
Arithmetic operators
| |
All of the mentioned
|
Question 14
|
typedef int (*PFI)(char *, char *)creates
type PFI, for pointer to function (of two char * arguments) returning int
| |
Error
| |
type PFI, function (of two char * arguments) returning int
| |
type PFI, for pointer
|
Question 15
|
typedef declaration
Does not create a new type
| |
It merely adds a new name for some existing type.
| |
Both a & b
| |
None of the mentioned
|
Question 16
|
What is the output of this C code?
Compile time error
| |
Varies
| |
hi
| |
h
|
Check Your Answers:
1. A
2. D
3. D
4. A
5. B
6. A
7. A
8. B
9. D
10. B
11. B
12. B
13. D
14. A
15. C
16. A
0 comments:
Post a Comment