#include <iostream>
using namespace std;
struct list
{
int data;
list *next;
};
list *node, *tail = NULL, *head = NULL;
void add2list();
void extrem();
int main()
{
add2list();
extrem();
return 0;
}
void add2list()
{
int input;
cout << "Adding values to list :\n";
cout << ">>";
while(cin >> input)
{
node = new list;
node->data = input;
node->next = NULL;
if (head == NULL)
{
head = node;
tail = node;
}
else
{
tail->next = node;
tail = node;
}
cout << ">>";
}
}
void extrem()
{
int x, y;
cin >> x >> y;
}
当我运行此程序它仅执行add2list功能????CIN对象 - C++
我已经添加了cin.clear(),但问题没有解决,为什么?
somecan得到约如何解决这个
和当是利用cin.clear的()对象有用清楚explaintion ??
对不起4我的英语不好
你怎么知道极端的ISN没有被执行?它什么都不做? – Antimony 2012-08-16 00:20:16