VS2010学习版cout的一个问题

hsf1002 2014-07-04 11:53:29
DataType x;
...
SeqQueueDelete(&S, &x);
cout << "the queue after delete the front item: " << x << endl;

运行程序一闪而过,在cout那句打断点后F11,一执行就会跑到这里:
template<class _Traits> inline
basic_ostream<char, _Traits>& operator<<(
basic_ostream<char, _Traits>& _Ostr,
const char *_Val)
{ // insert NTBS into char stream
typedef char _Elem;
typedef basic_ostream<_Elem, _Traits> _Myos;


SeqQueueDelete的定义如下:
int SeqQueueDelete(SeqQueue *Q, DataType *x)
{
if ( SeqQueueIsEmpty(*Q) )
{
cout << "SeqQueue empty, cant's delete. " << endl;
exit(0);
}
else
{
*x = Q->data[Q->font];
Q->font = (Q->font + 1) % MAX_SIZE;
Q->count--;
}

return 0;
}
...全文
159 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hsf1002 2014-07-05
  • 打赏
  • 举报
回复
引用 1 楼 zmlovelx 的回复:
估计是把到exit(0) 那句去了。 程序自己退出
没有走exit(0),走得是下面的else,*x也是一个正常的int值,很奇怪。
modyaj 2014-07-05
  • 打赏
  • 举报
回复
却是是运行完了就退出了 并没有什么其他的问题
帅得不敢出门 2014-07-05
  • 打赏
  • 举报
回复
估计是把到exit(0) 那句去了。 程序自己退出

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧