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
{
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:
____________________
What will be an ideal response?
1) List the letters of the lines that give the message from the unnamed namespace:
__a) and d)____________
2) List the letters of the lines that give the message from the Savitch namespace:
__b) and c)____________
Explanation: a) is a use of message() in a file with an unnamed namespace
containing a definition of message(). This is an invocation of the unnamed.
namespace function. b) is a use of a qualified name, Savitch::message().
This is a use of the name from the Savitch namespace. c) follows a using
declaration of message from the Savitch namespace, that is also a use of
message() from that namespace. The block ends, so the using declaration
expires, and the next message() is from the unnamed namespace again.
You might also like to view...
For two systems to communicate across a TCP/IP network, the system sending thepacket must map the address of the destination computer to the physical or mediaaccess control (MAC) address, which is a unique 12-digit hexadecimal number thatis burned into ROM on every network adapter card. The ________ Protocol detects and updates a table that matches physical addresses with IP addresses
Fill in the blank(s) with correct word
Click the color ____ on the Color panel, shown in the accompanying figure, to select a foreground or background color, and then adjust the color using the color sliders.
a. dialog box b. button c. ramp d. tool
The first slide rule appeared around ____.
A. 1183 B. 1622 C. 1882 D. 1945
What security certification did the "The International Council of Electronic Commerce Consultants" (EC-Council) develop?
A. Security+ B. OSSTMM Professional Security Tester (OPST) C. Certified Information Systems Security Professional (CISSP) D. Certified Ethical Hacker (CEH)