Advertisement
huutho_96

đọc file

May 26th, 2015
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. //https://www.facebook.com/pages/C%C3%B9ng-h%E1%BB%8Dc-l%E1%BA%ADp-tr%C3%ACnh/632038696941833
  2. void ReadFile(List &L, string path = "")
  3. {
  4. fstream f;
  5. f.open(path, ios::out | ios::in);
  6. char c;
  7. if (f)
  8. {
  9. while (!f.eof())
  10. {
  11. f >> c;
  12. if (f.eof()) break;
  13. AddHead(L, CreateNode(c - 48));
  14. }
  15. }
  16. else cout << "path error\n";
  17. f.close();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement