string 转int string str="123"; int i; i=atoi(str.c_str());
cin.getline()输入最后会自动丢弃回车符
cin.clear()是不会清除最后的回车符的
如果想清楚最后那个回车符,必须调用一次cin.get()!
关于模板类:
错误 1
error C2955: “List”: 使用类 模板 需要 模板 参数列表 e:c++
umber10
umber10list.cpp
6 1
number10
template <class T>
class List{/**/}
cpp实现:
template <class T>
List<T>::List() //模板类的定义必须有模板参数,不能写出List::List!!
{
front=rear=nullptr;
qsize=0;
}