ex1_04.cpp

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

CPP
21
字号
// Exercise 1.4 If the using directive is missing from the code, the program will not compile. 
// The cout statement will produce an error. The problem could be rectified by altering the program code to:

#include <iostream>
int main() {
  std::cout << std::endl
            << "Hello World"
            << std::endl;

  return 0;
)

/*
This specifies the namespace for the standard library that the missing line allowed you to omit.
Alternatively you could just add the following using directives:

using std::cout;
using std::endl;

Either solution is better than the original because the original will introduce all the names from the iostream header into the source file. 
*/

⌨️ 快捷键说明

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