- 論壇徽章:
- 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(".");
- }
- }
復(fù)制代碼 當(dāng)else為 :
printf("port: %hu is closed\n", dest_port); 時,可以正常執(zhí)行并程序結(jié)束
但是,當(dāng)沒加else,或是加了 else,用的是 ; 或 continue或 printf("." ;時, 當(dāng) dest_port從1記到1000時, 終端就不輸出東西了,然后出現(xiàn)了等待的閃爍符,然后程序也不會結(jié)束。
不知道這是什么原因?qū)е,感覺好奇怪,難道要加 fllush什么的嗎?
以前沒遇到過這種問題,還請大家?guī)兔Ψ治鱿,謝謝!
懸賞鏈接:
http://www.72891.cn/thread-1765860-1-1.html |
|