Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <vector>
- using namespace std;
- struct AllGroceries
- {
- string name;
- double weight;
- double price;
- };
- void getnames(vector<AllGroceries> &, int);
- void getweight(vector<AllGroceries> &, int);
- void getprice(vector<AllGroceries> &, int);
- int main()
- {
- ifstream groceriestxt;
- vector<string> everythingfromfile;
- vector<AllGroceries> groceries;
- string FromFile;
- int total = 0, index = 0;
- groceriestxt.open("groceries.txt");
- if (groceriestxt)
- {
- cout << "Reading the file groceries.txt...."; /* File Exists! */
- while (groceriestxt >> FromFile)
- {
- everythingfromfile.push_back(FromFile);
- }
- // getnames(groceries, total);
- }
- int stop;
- cin >> stop;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement