Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
任何人都可以帮助我弄清楚以下哪些代码无法成功构建:
#include <iostream> int main(void){ std::string str1("sfsfasfdsdf"); std::cout << str1 << std::endl; return 1; }
谢谢。
你必须包括std::string标题:
std::string
#include <string>
编辑:根据@ShafikYaghmour 的评论,includeiostream有时会带来string,但如果您只有发布的代码,则可能并非如此。
iostream
string