I am trying to write and read entered text into a text file. I have managed to write into the text file but reading from it is proving a challenge. I can provide a snippet of code. and stud is an object of a class students. I'm using c++.
Code:
{
string str;
int n, count = 0;
cout<<"Enter number of courses: ";
cin>>n;
for(int
I'm using c++(language)
i need to display number of students doing each course, seemingly it displays the first number well but the second time i try it adds all the students doing all courses. here's the code below:
Code:
{
string str;
int n, count = 0;
cout<<"Enter number of courses: ";
cin>>n;
for(int i=0; i<=n-1; i++)