Questions and Answers
- What is the use of no linkage?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
make the entity visible only to that block
- Which is used to use a function from one source file to another?
-
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.
- To use external linkage we have to use which keyword?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Extern keyword is used to represent identifiers from other programs.
- What is the default type of linkage that is available for identifiers?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
external
- 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;
}
-
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.