Ok I seem to be moving backwards with learning this language...
I have two getline functions which are exactly the same... yet one spits out an error.
P:\KoA_Prog\main.cpp||In function `int main()':|
P:\Koa_Prog\main.cpp|24|error: no matching function for call to `getline(std::istream&, int&)'|
||=== Build finished: 1 errors, 0 warnings ===|
Now with the help of legit I thought I had wrapped my head around classes but im guessing there must be a hook in it somewhere, I fixed a few bugs so maybe I messed up something.
using namespace std;
cout << "Welcome to my learning curve C++ Adventure Game Version 1.\n\n\n"; // Introduces the game
User NewUser; //Create a User object
std::string sTempUserName; //Create a temporary variable for input
int iTempAge; //Create a temporary variable for input
cout << "Please enter the username of your choice: ";
getline(cin,sTempUserName); //Store the user input in the temporary variable
std::cout << "\nAnd now your Age: ";
getline(cin,iTempAge); //Store the user input in the temporary variable
NewUser.vSetUserName(sTempUserName); //Set the username
NewUser.vSetAge(iTempAge); //Set the age
The wierd thing is its only this line, so there must be a rule im missing.
Oh and I have random std::'s in there because I got help by someone who uses it, where as I dont, and where i fixed stuff I removed it
so tahts why it dodgy