Well, this project I'm working on is a Pokedex Program for my little sister for her birthday.
Anyways, I have a file PokeList.txt, which I want to store every Pokemon next to their ID number.
The text file is:
1. Bulbasaur
2. Ivysaur
3. Venusaur
4. Charmander
5. Charmeleon
6. Charizard
The script is:
std::string Pokemon::ListPokemon() {
std::ifstream file;
std::string filename = "PokeList.txt";
file.open(filename.c_str());
if(!file.is_open()) {
return "An error occured while trying to open PokeList.txt, file reading failed...\n";
}
while(!file.eof()) {
}
file.close();
}
I need it to put each line in an array from the text file. So basicly it will put them in the array like:
array("1. Bulbasaur", "2. Ivysaur") etc...
Help please, thanks ;)