私は最近プログラムに取り組んでおり、System::String^ を使用してストリーム外ファイルに使用しようとしました...
いつもエラーが発生します... 注これはフォームであるため、ヘッダー ファイルです。
これは私のコードです...(一部)
System::String^ txtPath;
#pragma endregion
private: System::Void btn1_Click(System::Object^ sender, System::EventArgs^ e) {
using namespace std;
ofstream fout (txtPath->c_str());
}
private: System::Void txtBox1_TextChanged(System::Object^ sender, System::EventArgs^ e) {
txtPath=(Convert::ToString(txtBox1->Text))+"\\weapon_deagle.txt";
}
私が得るエラーは次のとおりです。
Error 1 error C2039: 'c_str' : is not a member of 'System::String' c:\users\a\documents\visual studio 2010\projects\d1s1k formed\d1s1k formed\Form1.h
101