for(; 0;)printf(" hello"); [英] for(;0;) printf("hello");

查看:72
本文介绍了for(; 0;)printf(" hello");的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

for(; 0;)

printf(" hello");


即使条件错误我也会在屏幕上打印你好

ys发生这种情况

解决方案

Spidey说:


for(; 0;)

printf(" hello");


即使条件错误我也打印了你好打招呼屏幕

ys发生这种情况



Y hnpe c。


-

Richard Heathfield

Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上面的域名(但显然放弃了www)


Richard Heathfield写道:
< blockquote class =post_quotes>
Spidey说:


for(; 0;)

printf(" hello" );


即使条件错误我也会在屏幕上打印你好

ys发生这种情况



Y hnpe c。



Th s n exl rpl;我知道我该怎么做。


Richard Heathfield写道:


Spidey说:


> for(; 0;)
printf(" hello");

即使条件错误我在屏幕上打印了你好。
这发生了什么



Y hnpe c。



"你还没有发布完整的代码。"?


#include< stdio.h>


int main(无效)

{

for(; 0;)

printf("你好);


返回0;

}


我在4个不同的编译器上试过它而没有他们在屏幕上打印了你好。
其中一人警告无法访问的代码。


-

Simon。


for(;0;)
printf("hello");

even the condition s wrong i get a hello printed on the screen
y s this happening

解决方案

Spidey said:

for(;0;)
printf("hello");

even the condition s wrong i get a hello printed on the screen
y s this happening

Y h n p e c.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)


Richard Heathfield wrote:

Spidey said:

for(;0;)
printf("hello");

even the condition s wrong i get a hello printed on the screen
y s this happening


Y h n p e c.

Th s n exl rpl ; i ws i hd tht f it mslf.


Richard Heathfield wrote:

Spidey said:

>for(;0;)
printf("hello");

even the condition s wrong i get a hello printed on the screen
y s this happening


Y h n p e c.

"You have not posted entire code."?

#include <stdio.h>

int main(void)
{
for(;0;)
printf("hello");

return 0;
}

I tried it on 4 different compilers and none of them printed hello on
the screen. One of them warned about unreachable code.

--
Simon.


这篇关于for(; 0;)printf(&quot; hello&quot;);的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆