Problem Solving with C++ (10th Edition)
Problem Solving with C++ (10th Edition)
10th Edition
ISBN: 9780134448282
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
bartleby

Concept explainers

Expert Solution & Answer
Book Icon
Chapter 12.2, Problem 13STE

Explanation of Solution

Program:

//Header file

#include <iostream>

//For standard input and output

using namespace std;

//Create namespace "sally"

namespace sally

{

//Function declaration for message()

 void message( );

}

//Create unnamed namespace

namespace

{

 //Function declaration for message()

 void message( );

}

//Main function

int main( )

{

 {

/* Call the message() function for unnamed namespace */

  message( );

/* Call the function message() by "using" directive */

  using sally::message;

  //Call message() function

  message( );

 }

/* Call the message() function for unnamed namespace */

  message( );

 return 0;

}

/* Create function definition of namespace for "message()" function */

namespace sally

{

 /* Function definition for message() */

 void message( )

 {

   /* Display message */

 cout << "Hello from Sally.\n";

 }

}

/* Create function definition of unnamed namespace for "message()" function */

namespace

{

 void message( )

 {

   /* Display message */

 cout << "Hello from unnamed.\n";

 }

}

Explanation:

The given code is used to display the message from “sally” namespace and unnamed namespace...

Blurred answer
Students have asked these similar questions
Please answer both Exercise 1 and2(these questions are not GRADED)
Discussion 1. Comment on your results. 2. Compare between the practical and theoretical results. 3. Find VB, Vc on the figure below: 3V V₁₁ R₁ B IR, R, IR, R www ΙΚΩ www www I 1.5KQ 18₁ 82002 R₁ 3.3KQ R₂ 2.2KQ E D
Agile1. a. Describe it and how it differs from other SDLC approachesb. List and describe the two primary terms for the agile processc. What are the three activities in the Construction phase
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage