Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. char ch1 = ',';
  2.     char ch2 = '|';
  3.    
  4.     inp.open("grade_report.txt");
  5.    
  6.     if(inp.peek() == '\n' || inp.peek() == ch1)inp.ignore();
  7.     getline(inp,name,ch1);
  8.     s1.set_name(name);
  9.     if(inp.peek() == ch1)inp.ignore();
  10.     getline(inp,pid,ch1);
  11.     s1.set_pid(pid);
  12.     inp>>mess;
  13.  
  14.  
  15.     while(!inp.eof())
  16.     {  
  17.         while(inp.peek() == '\n'|| inp.peek() == ch2 || inp.peek() == ch1)inp.ignore();
  18.         getline(inp,course,ch2);
  19.         if(inp.peek() == ch2)inp.ignore();
  20.         getline(inp,grade,ch2);
  21.         if(inp.peek() == ch2)inp.ignore();
  22.         inp >> hours;              
  23.         s1.add_to_list(create_new(course,grade,hours));
  24.     }
  25.  
  26.  
  27.  
  28. //this is my file from which i am reading!
  29. Evgueni Neiman,P001109646,4.0,4
  30.  
  31. |MATH263B|A|4|
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement