Preprocessors


  1. How is search done in #include and #include ”somelibrary.h” normally or conventionally?











  1. 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


  1. Can function definition be present in header files?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Yes



  1. Comment on the output of the following C code.
    #include <stdio.h>
    #include "test.h"
    #include "test.h"
    int main()
    {
    //statements...
    }











  1. 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.


  1. 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));
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    1015



  1. Which of the following names for files not accepted?











  1. 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.