# include #include #include using std::string; using std::ofstream; using std::cout; using std::endl; void Main() { //カレントディレクトリ取得 std::filesystem::path crrpath = std::filesystem::current_path(); Font font{ 30 }; ofstream out_file;//ファイルストリームのインスタンスを作成 string fname = "output.txt"; //書き込み用ファイル名を指定(好きな名前でいいよ) out_file.open(fname, std::ios::out);//ストリームがオープンする //oFileNameのファイル名のファイルを、上書きモードでオープン if (out_file.fail()) { Console.open(); std::cout << "ファイルオープンに失敗しました!" << std::endl; exit(0); } //書き込み部分 int idata = 10; //書き込み用データ char cdata = 's'; //書き込み用データ float fdata = 3.14; //書き込み用データ string str = "Hi! I'm very very happy today.";//書き込み用データ out_file << str << endl;//ストリームにデータを流す out_file << idata << "," << cdata << "," << fdata << endl; out_file << crrpath.string() << endl; out_file.close();//ストリームを閉じる while (System::Update()) { font(ファイルパスをUTF-32にごにょごにょ).draw(Vec2{ 10,Scene::Center().y }, Palette::White); } }