323 C:\My Documents\Jake's Documents\Dragons End\Helper.cpp no matching function for call to `std::basic_ifstream<char, std::char_traits<char> >::get(int&)'
What does it mean and what can I do.
And it's in a .txt file. Is that my problem?
Posted 29 June 2006 - 12:30 PM
323 C:\My Documents\Jake's Documents\Dragons End\Helper.cpp no matching function for call to `std::basic_ifstream<char, std::char_traits<char> >::get(int&)'
Posted 29 June 2006 - 01:57 PM
Posted 29 June 2006 - 04:59 PM
void LoadGame() { ifstream File("C:/stats.txt"); char name[32]; char load[32]; int amount; File.getline(name,32); player.SetName(name); File.get(amount); player.SetAttack(amount); //Load Everything File.close(); cout << player.GetName() << endl; cout << player.GetAttack() << endl; //Display Everything Wait(); }Here it is.
Edited by jakevfr, 29 June 2006 - 05:01 PM.
Posted 29 June 2006 - 05:49 PM
int number; ifstream myfile ("example.txt"); if (myfile.is_open()) { while (! myfile.eof() ) { myfile >> number; } myfile.close(); } else { cout << "Unable to open file" << endl; }
int number[10]; ifstream myfile ("example.txt"); if (myfile.is_open()) { while (! myfile.eof() ) { for(int x = 0; x < 10; x++) { myfile >> number[x]; } } myfile.close(); } else { cout << "Unable to open file" << endl; }
Posted 29 June 2006 - 06:16 PM
Posted 29 June 2006 - 07:06 PM
0 members, 0 guests, 0 anonymous users