print.cpp

来自「一本语言类编程书籍」· C++ 代码 · 共 16 行

CPP
16
字号
// Exercise 10.3 Using namespaces. The solution is as Exercise 10.2, with changes to
// print.h, print.cpp, printthis.cpp and printthat.cpp: 

// print.cpp
#include "print.h"
#include <string>
#include <iostream>
using std::string;

void print1::print(const string& s) {
  std::cout << s << " (Namespace name is print1.) " << std::endl;
}

void print2::print(const string& s) {
  std::cout << s << " (Namespace name is print2.) " << std::endl;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?