Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char ch1 = ',';
- char ch2 = '|';
- inp.open("grade_report.txt");
- if(inp.peek() == '\n' || inp.peek() == ch1)inp.ignore();
- getline(inp,name,ch1);
- s1.set_name(name);
- if(inp.peek() == ch1)inp.ignore();
- getline(inp,pid,ch1);
- s1.set_pid(pid);
- inp>>mess;
- while(!inp.eof())
- {
- while(inp.peek() == '\n'|| inp.peek() == ch2 || inp.peek() == ch1)inp.ignore();
- getline(inp,course,ch2);
- if(inp.peek() == ch2)inp.ignore();
- getline(inp,grade,ch2);
- if(inp.peek() == ch2)inp.ignore();
- inp >> hours;
- s1.add_to_list(create_new(course,grade,hours));
- }
- //this is my file from which i am reading!
- Evgueni Neiman,P001109646,4.0,4
- |MATH263B|A|4|
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement