for (int i = 0; i < count; i++)
{
cout << "enter the name:";
cin >> student[i].name;
{
stu.open(student[i].name + ".txt");
cout << "enter the student_id:";
cin >> student[i].student_id;
stu << student[i].student_id;
cout << "enter the sex:";
cin >> student[i].sex;
stu << " " << student[i].sex;
cout << "enter the age:";
cin >> student[i].age;
stu << " " << student[i].age;
cout << "enter the grade:";
cin >> student[i].grade;
stu << " " << student[i].grade;
cout << "enter the address";
cin >> student[i].address;
stu << " " << student[i].address;
stu.close();
cout << "sure?y/n";
char aaaa;
cin >> aaaa;
if (aaaa == 'n' || aaaa == 'N')
{
wstring aaa =student[i].name+"1.txt";//這里不知道怎么給引數
LPCWSTR str=aaa.c_str();
DeleteFile(str);
}
}
}
uj5u.com熱心網友回復:


這里txt1檔案不保存內容,我也不知道為什么
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/118697.html
標籤:C++ 語言
上一篇:TestDataAnalysis軟體StdfToCSV轉換使用說明
下一篇:VS2019結構體排序錯誤
