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.
Correct Answer:
Verified
Q24: Carefully distinguish the using directive
using namespace std;
from
Q25: The output from the following code is
"function".
(The
Q26: Given the namespace groupings that contain
Q27: You can declare several names from a
Q28: What is the problem that the C++
Q30: Consider the iostream library,in particular,cout and endl.Assume
Q31: Suppose we have the following namespace:
namespace A
{
void
Q32: We are interested in providing a class,say
Q33: Use a namespace grouping to insert this
Q34: Suppose the following code is embedded
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents