没有输出...... [英] No output...
问题描述
我没有得到以下代码行的任何输出...
而(line_buf>> value)
{
cout<<"推送列表中的值"<<< endl;
line_list.push_front(value); //将值添加到列表
cout<<"得到列表中的值"<< endl;
}
上面给出的代码是't执行。由于某种原因,
代码中的while循环没有被执行。
我已经将line_buf定义如下:
std :: istringstream line_buf(line);
任何帮助都将不胜感激...
I am not getting any output for the following lines of code...
while(line_buf>>value)
{
cout<<"Pushing a value in the list"<<endl;
line_list.push_front(value);//add the value to the list
cout<<"Got the value in the list"<<endl;
}
The above given code isn''t executed.For some reason the while loop in the
code doesn''t gets executed.
I have defined line_buf as the following:
std::istringstream line_buf(line);
Any help would be appreciated...
推荐答案
supratik chakraborty写道:
supratik chakraborty wrote:
我没有得到以下几行的输出代码...
while(line_buf>> value)
{
cout<<"推送列表中的值"<< endl;
line_l ist.push_front(value); //将值添加到列表中
cout<<"获取列表中的值"<< endl;
}
上面给出的代码没有被执行。由于某种原因,
代码中的while循环没有被执行。
I am not getting any output for the following lines of code...
while(line_buf>>value)
{
cout<<"Pushing a value in the list"<<endl;
line_list.push_front(value);//add the value to the list
cout<<"Got the value in the list"<<endl;
}
The above given code isn''t executed.For some reason the while loop in the
code doesn''t gets executed.
那么可能是什么那个原因是什么?
如果没有执行while循环体,那么这是因为
while条件的计算结果为false。
在你的案例:价值提取失败。
要解决这个问题,我们需要更多细节:
什么是数据类型的值?
line_buf中存储的是什么?
字符串流是否已经进入失败状态?
等...
>
-
Karl Heinz Buchegger
kb ****** @ gascad.at
supratik chakraborty< sc ****** @ students.uiuc.edu>在留言中写道
新闻:Pi ************************************ ** @ UX7。 cso.uiuc.edu ...
supratik chakraborty <sc******@students.uiuc.edu> wrote in message
news:Pi**************************************@ux7. cso.uiuc.edu...
我没有得到以下代码行的任何输出......
while(line_buf>> value)
{
cout<<"推送列表中的值<<< endl;
line_list.push_front(value); //将值添加到列表中
cout< <"得到列表中的值"<< endl;
}
上面给出的代码没有被执行。由于某种原因,在
代码没有被执行。
我已经将line_buf定义如下:
std :: istringstream line_buf(line);
I am not getting any output for the following lines of code...
while(line_buf>>value)
{
cout<<"Pushing a value in the list"<<endl;
line_list.push_front(value);//add the value to the list
cout<<"Got the value in the list"<<endl;
}
The above given code isn''t executed.For some reason the while loop in the
code doesn''t gets executed.
I have defined line_buf as the following:
std::istringstream line_buf(line);
''line''的定义和内容是什么?
-Mike
What are the definition and contents of ''line''?
-Mike
2003年8月13日星期三,Mike Wahler写道:
On Wed, 13 Aug 2003, Mike Wahler wrote:
supratik chakraborty< sc ***** *@students.uiuc.edu>在消息中写道
新闻:Pi ************************************** @ ux7 。 cso.uiuc.edu ...
supratik chakraborty <sc******@students.uiuc.edu> wrote in message
news:Pi**************************************@ux7. cso.uiuc.edu...
我没有得到以下代码行的任何输出......
while(line_buf>> value)
{
cout<<"推送列表中的值<<< endl;
line_list.push_front(value); //将值添加到列表中
cout< <"得到列表中的值"<< endl;
}
上面给出的代码没有被执行。由于某种原因,在
代码没有被执行。
我已经将line_buf定义如下:
std :: istringstream line_buf(line);
I am not getting any output for the following lines of code...
while(line_buf>>value)
{
cout<<"Pushing a value in the list"<<endl;
line_list.push_front(value);//add the value to the list
cout<<"Got the value in the list"<<endl;
}
The above given code isn''t executed.For some reason the while loop in the
code doesn''t gets executed.
I have defined line_buf as the following:
std::istringstream line_buf(line);
''line''的定义和内容是什么?
-Mike
What are the definition and contents of ''line''?
-Mike
Line是一个字符串。 string从.txt文件中获取值。文本文件
的数据排列如下:
1,2,3
3,4,5
6,7,8
......
......
Line is a string.The string takes in values from a .txt file.The text file
has its data arranged as follows:
1,2,3
3,4,5
6,7,8
......
......
这篇关于没有输出......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!