Short Answer
Here is some code.There are only two outputs,one a message from the unnamed namespace the other a message from the Savitch namespace.Tell which line generates which message.
#include <iostream>
using namespace std;
namespace
{
void message();
}
namespace Savitch
{
void message();
}
int main()
{
{
message();//a)
Savitch::message();//b)
using Savitch::message;
message();//c)
}
message();//d)
return 0;
}
namespace Savitch
{
void message()
{
cout << "Message from NS Savitch\n";
}
}
namespace
{
void message()
{
cout <<"Message from unnamed NS\n";
}
}
1)List the letters of the lines that give the message from the unnamed namespace: ____________________
2)List the letters of the lines that give the message from the Savitch namespace: ____________________
Correct Answer:

Verified
1)a)and d)...View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q6: Namespaces may not be nested.
Q7: Carefully distinguish the using directive<br>using namespace std;<br>from
Q8: An unnamed namespace provides a facility for
Q9: Any global declarations or definitions can be
Q10: You have a helping function that is
Q12: If I have already written the #include
Q13: During name resolution,nested namespaces behave like nested
Q14: The following program has been partitioned into
Q15: In a particular file,the names from the
Q16: A namespace is a collection of name