-3

为什么Visual Studio 2019 Enterprise版不支持C++的默认格式,我用了很久Code-Blocks还在用。Code Blocks 是我从 C++ 开始的第一个 IDE,现在对于图形界面我使用 Visual Studio,但是在编辑源代码时,Visual Studio 不接受 Code-Blocks 中接受的许多东西。一个小例子是在视觉工作室中声明 astring是不可接受的,但它需要String正常工作。也许这是一个编译器问题,但我并不熟悉所有编译器,我在代码块中使用了 minGW。 源图像

4

1 回答 1

0

你会发现你没有包含字符串头,也没有真正引用 std::string 对象。

要导入:

#include <string>

using std::string; // This is optional, but it saves you from having to type std::string all the time.
于 2021-01-18T12:22:31.783 回答