我有一个 C++ 程序。我需要显示我的文本和变量。 我的代码:
String^ MyVariable;
MyVariable = folderBrowserDialog1->SelectedPath // C://User/Users
std::ofstream out;
out.open("hello.txt");
if (out.is_open())
{
out << "Variable: " << MyVariable << std::endl; // ERROR
}
out.close();
如何修复错误?