Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I declare my int main
- int main(int argc, char*argv[]){
- do some file stuff
- ifstream f1 (argv[1]); //change to command line file name
- //ifstream f1 ("mens_2014_fo.txt");
- ofstream f2 ;
- while(!(f1.eof())){
- getline(f1,line);
- file_info.push_back(line); //adds next line of file to vector
- }
- num_lines= file_info.size(); //number of lines is length of vector
- do some read out stuff
- f1.close();
- f2.open(argv[2]);
- f2<< "MATCH STATISTICS"<< endl;
- f2<< setw(25) << "Player" << setw(6) << "W" << setw(6) << "L" << setw(15) << "percentage" << endl;
- sort(tennis_vector.begin(), tennis_vector.end(), sort_matches);
- for (int i=0; i< tennis_vector.size(); i++){
- tennis_vector[i].print_match();
- }
- f2<< "GAME STATISTICS"<< endl;
- f2<< setw(25) << "Player" << setw(6) << "W" << setw(6) << "L" << setw(15) << "percentage" << endl;
- sort(tennis_vector.begin(), tennis_vector.end(), sort_games);
- for (int i=0; i< tennis_vector.size(); i++){
- tennis_vector[i].print_game();
- }
- f2<< "SET STATISTICS"<< endl;
- f2<< setw(25) << "Player" << setw(6) << "W" << setw(6) << "L" << setw(15) << "percentage" << endl;
- sort(tennis_vector.begin(), tennis_vector.end(), sort_sets);
- for (int i=0; i< tennis_vector.size(); i++){
- tennis_vector[i].print_set();
- }
- f2.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement