代码如下,输出的文件中没有内容……不知道为嘛……哪里有问题么?为什么?要怎么修改?
#include
#include
#include
#include
#include
using namespace std;
class Student_Info{
public:
vector name;
vector score;
};
int main()
{
Student_Info S;
char name;
double score;
vector::const_iterator n;
vector::const_iterator s;
ofstream OutFile("students.txt", ios::out|ios::binary );
while (cin >> name >> score){
S.name.push_back(name);
S.score.push_back(score);
}
for (n = S.name.begin(); n != S.name.end(); n++){
for (s = S.score.begin(); s != S.score.end(); s++){
OutFile <
}
}
OutFile.close();
system("pause");