void ChangePassStudent(Student*& s, int n,string username) { ifstream fin; fin.open("CS162\\Student\\Student.txt", ios::in); if (!fin.is_open()) { cout << "Can not open file" << endl; return false; } fin >> n; s = new Student[n]; for (int i = 0; i < n; i++) { fin.ignore(); ReadStudent(fin, s[i]); } ofstream fout; fout.open("CS162\\Student\\Student.txt", ios::in); if (!fout.is_open()) { cout << "Can not open file" << endl; return false; } for (int i = 0; i < n; i++) { if (Compare(username, s[i].Account)) { string resetpass, resetpass2, pass; cout << "Enter the old password: "; cin >> pass; cout << "Enter the new password: "; cin >> resetpass; cout << "Enter password again: "; cin >> resetpass2; if (Compare(pass, s[i].Password)) { if (Compare(resetpass, resetpass2)) { s[i].Password = resetpass; cout << "CHANGED PASSWORD SUCCESSFUL" << endl; } else if (!Compare(pass, s[i].Password) || !Compare(resetpass, resetpass2)) { cout << "CHANGED PASSWORD UNSUCCESSFUL !!!"<