This one is kinda specific. I want to be able to retrieve an integer from the user using a function rather than cin. I have tried several different things, but none seem to work so I have just wound up writing my own function. It really does baffle me though because it seems like something that would have a function in existence already. Here it is:
int getInt()
{
int num;
cin >> num;
return num;
}
I have tried using cin.get(), but that returns the ascii number for the integer. The getline() functions are all for strings. It just doesn't make sense that this function doesn't exist! If you know of any function or in-line equivalent that could be passed as a parameter to a function, let me know.
>>is a function here.int x = getInt();