Examlex

Solved

Here Is Some Code

question 11

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: ____________________


Definitions:

Alcohol

A psychoactive substance found in drinks such as beer, wine, and liquor, which can alter mood and behavior.

Alcoholics Anonymous

A worldwide fellowship program for individuals seeking to overcome alcoholism through a 12-step recovery process.

Sin Tax

A form of tax levied on goods or activities considered harmful to society, such as tobacco, alcohol, and gambling, intended to discourage their consumption.

Minimum Drinking Age

The legal age at which an individual is allowed to purchase and consume alcoholic beverages.

Related Questions