You want to use only one name, funct1, from name space MyNamespace. The directive #include “MyNamespace” has been places at the top of the file. You will call this function a large number of times in a block. Which of the following will make only the name funct1 available only in that block (not outside the block)?

a. Place
using namespace std;
just after your #include directives.
b. Place
using namespace MyNamespace;
just after your other #include directives.
c. Place
using namespace MyNamespace;
just inside the block where you want to use funct1.
d. Place
using MyNamespace::func1;
just inside the block where you want to use funct1.
e. Place #include “MyNamespace” at the top of the file where you are using the name func1.

d)
Explanation: Part a) does not make the function available as the question asks, rather it makes all the names from namespace std available in the file. Part b) makes the name funct1 available everywhere in the file. Part c) makes all the names in namespace MyNamespace available in the block. Only part d) makes only the name funct1 available only in the block were it is to be used.
Free Form Questions:

Computer Science & Information Technology

You might also like to view...

In what cases are adapter classes useful?

a. When an adapter GUI control is clicked. b. When every method in the event-listener interface is to use the same functionality. c. When it is not desirable to declare every method in the event-listener interface. d. None of the above.

Computer Science & Information Technology

Identify the major steps to install an end user PC.

What will be an ideal response?

Computer Science & Information Technology