Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. struct AllGroceries
  8. {
  9. string name;
  10. double weight;
  11. double price;
  12. };
  13.  
  14. void getnames(vector<AllGroceries> &, int);
  15. void getweight(vector<AllGroceries> &, int);
  16. void getprice(vector<AllGroceries> &, int);
  17.  
  18. int main()
  19. {
  20. ifstream groceriestxt;
  21. vector<string> everythingfromfile;
  22. vector<AllGroceries> groceries;
  23. string FromFile;
  24. int total = 0, index = 0;
  25.  
  26. groceriestxt.open("groceries.txt");
  27.  
  28. if (groceriestxt)
  29. {
  30. cout << "Reading the file groceries.txt...."; /* File Exists! */
  31. while (groceriestxt >> FromFile)
  32. {
  33. everythingfromfile.push_back(FromFile);
  34. }
  35.  
  36.  
  37.  
  38.  
  39. // getnames(groceries, total);
  40. }
  41.  
  42. int stop;
  43. cin >> stop;
  44. return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement