相关资料:
http://bbs.csdn.net/topics/330194465
#include <string>
将string库包含到当前编译单元中.
using std::string;
一个编译单元会有很多域...一般,这个只会出现在单独的域中.这样做是避免三件事.
1, 将std里的所有名字暴露在各个域中, 例如 把using namespace std; 写在全局中.
2, 在using std::string的域中,就可以直接使用string, 少打std::了,图方便
相关资料:
http://bbs.csdn.net/topics/330194465
#include <string>
将string库包含到当前编译单元中.
using std::string;
一个编译单元会有很多域...一般,这个只会出现在单独的域中.这样做是避免三件事.
1, 将std里的所有名字暴露在各个域中, 例如 把using namespace std; 写在全局中.
2, 在using std::string的域中,就可以直接使用string, 少打std::了,图方便
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。