Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <iomanip>
- #include <fstream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- vector<char*>boysNames(1000);
- vector<char*>girlsNames(1000);
- vector<int>popNum(1000);
- ifstream babyNamesFile;
- babyNamesFile.open("babynames2004.txt");
- if (babyNamesFile.fail())
- {
- cout << "Opening input file failed.\n";
- cout << "Make sure you put .txt.\n";
- return 0;
- }
- while(!babyNamesFile.eof())
- {
- for(int i=0; i <= 999; i++)
- {
- babyNamesFile >> popNum[i] >> boysNames[i] >> girlsNames[i];
- }
- }
- babyNamesFile.close();
- cout << boysNames[12];
- }
Add Comment
Please, Sign In to add comment