- 论坛徽章:
- 0
|
本帖最后由 nine8 于 2010-08-12 22:26 编辑
- for (dest_port = start_port; dest_port <= end_port; dest_port++) {
- if (sub_func(xxx,xxx,xxxx.....) == 1) {
- printf("\nport: %hu is open\n", dest_port);
- }
- else {
- //;
- //continue;
- //printf("port: %hu is closed\n", dest_port);
- //printf(".");
- }
- }
复制代码 当else为 :
printf("port: %hu is closed\n", dest_port); 时,可以正常执行并程序结束
但是,当没加else,或是加了 else,用的是 ; 或 continue或 printf("." ;时, 当 dest_port从1记到1000时, 终端就不输出东西了,然后出现了等待的闪烁符,然后程序也不会结束。
不知道这是什么原因导致,感觉好奇怪,难道要加 fllush什么的吗?
以前没遇到过这种问题,还请大家帮忙分析下,谢谢!
悬赏链接:
http://bbs.chinaunix.net/thread-1765860-1-1.html |
|