Questions and Answers


  1. What is the use of no linkage?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    make the entity visible only to that block


  1. Which is used to use a function from one source file to another?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    By defining a function’s prototype in another file means, we can inherit all the features from the source function.



  1. To use external linkage we have to use which keyword?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Extern keyword is used to represent identifiers from other programs.


  1. What is the default type of linkage that is available for identifiers?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    external



  1. What will be the output of these two programs?
    (i)
    #ifndef Example_H
    #define Example_H
    int n = 251;
    #endif

    (ii)
    #include 
    #include "Example.h"
    using namespace std;
    int main(int argc, char * argv[] )
    {
    cout << num++;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    In this program, we have created a header file and linked that into the source program and we post incrementing that because of that it is printed as 251.