如何在C++中显示变量?

问题描述 投票:0回答:0

我有一个 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();

如何修复错误?

c++-cli
© www.soinside.com 2019 - 2024. All rights reserved.