私は以下のフォームのコードを持っています:
func1()
{
fstream stud("student", fstream::in | fstream::out | fstream::app);
stud << "sameer";
stud.close();
}
func2()
{
string name;
fstream stud("student", fstream::in | fstream::out | fstream::app);
stud >> name;
stud.close();
}
ここでは、両方の機能が同じプログラムにありますが、閉じていても、ファイルを開いたfunc1
ときに変更が反映されません。stud
func2