Problem Solving with C++ plus MyProgrammingLab with Pearson eText-- Access Card Package (9th Edition)
Problem Solving with C++ plus MyProgrammingLab with Pearson eText-- Access Card Package (9th Edition)
9th Edition
ISBN: 9780133862218
Author: Walter Savitch
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
I need help in server client project. It is around 1200 lines of code in both . I want to meet with the expert online because it is complicated. I want the server send a menu to the client and the client enters his choice and keep on this until the client chooses to exit . the problem is not in the connection itself as far as I know.I tried while loops but did not work. please help its emergent
I need help in my server client in C language
Exercise docID document text docID document text 1 hot chocolate cocoa beans 7 sweet sugar 2345 9 cocoa ghana africa 8 sugar cane brazil beans harvest ghana 9 sweet sugar beet cocoa butter butter truffles sweet chocolate 10 sweet cake icing 11 cake black forest Clustering by k-means, with preprocessing tokenization, term weighting TFIDF. Manhattan Distance. Number of cluster is 2. Centroid docID 2 and docID 9.
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
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,