File Handling
File Handling
Class :BEE-14 A
Code :
#ifndef TEAM_H
#define TEAM_H
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
class Player {
public:
std::string name;
int matchesPlayed;
int runsScored;
int wicketsTaken;
int strike;
int halfCenturies;
int centuries;
int ballsPlayed;
double strikeRate;
int runsTaken;
};
class Team {
public:
std::vector<Player> players;
};
#endif
#include "team.h"
int main() {
Team myTeam;
// Reading data
myTeam.readData("players\\India.csv");
myTeam.printData();
myTeam.writeBestBatsman("best-batsman.csv");
myTeam.writeBestBowler("best-bowler.csv");
return 0;