Preprocessors
- How is search done in #include and #include ”somelibrary.h” normally or conventionally?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
When former is used, predefined directory is searched and when latter is used, current directory is searched and then predefined directories are searched
- Can function definition be present in header files?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Yes
- Comment on the output of the following C code.
#include <stdio.h>
#include "test.h"
#include "test.h"
int main()
{
//statements...
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Compilation Error
main.c:2:14: fatal error: test.h: No such file or directory
#include "test.h"
^~~~~~~~
compilation terminated.
- What will be the output of the following C code?
#include <stdio.h>
#define function(p, q) p ## q
void fun();
int main()
{
fun();
}
void fun()
{
printf("%d \n", function(10, 15));
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
1015
- Which of the following names for files not accepted?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
All file names are accepted as for the execution to occur. There are no constraints on giving file names for inclusion.