【发布时间】:2018-09-25 09:37:32
【问题描述】:
我正在使用带有 C++ 的 Windows 窗体应用程序。
我想将String^ 转换为int。
我的代码是:
int number = std::stoi(TextBox1->Text);
但错误显示:
no instance of overloaded function "std::stoi" matches the argument list argument types are :(System:: String ^)
前面^是什么意思String?
【问题讨论】:
-
问题是您认为您正在编写 C++,而实际上您正在使用一种名为 C++/CLI 的衍生语言进行编程,它是 Mircosofts 管理的 C++ 的 .NET 变体。它不向后兼容标准 C++。
标签: c++ string type-conversion int