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) Place
using MyNamespace::func1;
just inside the block where you want to use funct1.
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.
You might also like to view...
The =SUM function adds up the number of cells containing values in the specified range. ____________________
Answer the following statement true (T) or false (F)
What are the three blocks of frequencies used by wireless LANs and PANs?
What will be an ideal response?
Pages that contain cells that will not be printed are shown in _____.
A. white B. light blue C. yellow D. gray
________ provides an integrated development environment (IDE) for rapidly developing Java programs. Editing, compiling, building, debugging, and online help are integrated in one graphical user interface.
a. Java language specification b. Java API c. Java JDK d. Java IDE