-
I've arranged the code like this.
3 more functions to go.
Problem 1 :
If i want to remove student information,i must search the student with student ID.How can i search from the students.txt file ?
What function should I use ?
1.insert student id
2.open students.txt
3.search the students id from student.txt
4.if found,remove the student name,id
5.if not found, cout << " studen id not found";
-
That sounds like a lot of functions, might it be possible to create a text file for each student? I am working on a database program as well, I'ts almost finished, I only need to add encryption, anyhow, it would be way easier to have separate text files for each student, for example all called student*.txt, * being the students ID. Perhaps you could make student his name or so.
Then you could just delete the text file ( Or just its contents, you'll probably be using the same ID some other time. )
-
Great idea !
i just create this code :
Code:
cout << "Enter the name of the file you want to create: ";
cin >> FileName;
ofstream Students(FileName, ios::out);
Students
<< "********************************************************************" << "\n"
<< "Student ID : " << user[info].id << "\n"
<< "Student First Name : " << user[info].firstName << "\n"
<< "Student Last Name : " << user[info].lastName << "\n"
<< "Student Day Of Birth : " << user[info].dob1 << "\n"
<< "Student Month Of Birth : " << user[info].dob2 << "\n"
<< "Student Year Of Birth : " << user[info].dob3 << "\n"
<< "********************************************************************" << "\n";
but,the problem is....how about option no 5 ( Show Student Information )
What input should I put ?
i think i wanna save student information file with their ID number.
so,it will be easier for user to use option no 5.
the problem is, how can i save student information file with their ID number ?
-