【发布时间】:2017-07-20 03:10:31
【问题描述】:
我有这个网页:
http://www.stroustrup.com/Programming/PPP2code/std_lib_facilities.h
我正在完成Stroustrup 的一本书,并想做我需要做的事情,以便我可以开始我的程序,
#include "std_lib_facilities.h"
而不是,
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
我需要做什么?
【问题讨论】:
-
右键单击您刚刚提供的链接,选择“将链接另存为”,然后将文件保存到源代码所在的同一目录中。
-
我正在将我的源代码保存到我桌面上的一个文件夹中。我尝试将 .h 文件添加到该文件夹,修改源代码以使用 #include "std_lib..." 而不是命名空间,然后运行它,但我收到“std_... "。
-
你真的应该避免
using namespace std- 这是一个坏习惯,当你不期待它时can silently change the meaning of your program。习惯于使用命名空间前缀(std故意很短),或将只是您需要的名称 导入到最小合理范围。
标签: c++ macos sublimetext3 sublimetext header-files