No instance of overloaded function "input" matches the argument list
argument types are: (const char [##], int, int)
我尝试使用的函数如下
int input(char* t, int min, int max) {
int number;
do {
cout << '\t' << t << " (" << min << '-' << max << "): ";
cin >> number;
cin.ignore();
} while (number < min || number > max);
return number;
}
更好地解释一下。
这个
t
争论基本上就是所问的问题,例如:“你多大了”。
那里有
min
和
max
都是整数。
示例用法:
int years;
years = input("How old are you", 0, 110);