473,749 Members | 2,350 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

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

Sep 10 '06 #1
51 4135
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)
Sep 10 '06 #2
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.

Sep 10 '06 #3
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.
Sep 10 '06 #4
Spiros Bousbouras wrote:
Th s n exl rpl ; i ws i hd tht f it mslf.
I cannot understand this at all.
What's the meanning please ...

Sep 10 '06 #5
Aman JIANG wrote:
Spiros Bousbouras wrote:
Th s n exl rpl ; i ws i hd tht f it mslf.

I cannot understand this at all.
What's the meanning please ...
You mean you can understand Y h n p e c ?

Sep 10 '06 #6
Aman JIANG wrote:
Spiros Bousbouras wrote:
>Th s n exl rpl ; i ws i hd tht f it mslf.

I cannot understand this at all.
What's the meanning please ...
"This is an excellent reply; I wish I had thought of it myself."

The problem with communicating in such abbreviated forms is that it is
difficult and slow for to read for some and impossible for others.

--
Simon.
Sep 10 '06 #7
Simon Biber said:
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."?
Not what I had in mind, although you did get the first three words right.

As you have demonstrated, the more letters that are gratuitously omitted
from the words of an article, the harder it is to decide what the author
meant.

--
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)
Sep 10 '06 #8

Richard Heathfield wrote:
Simon Biber said:
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."?

Not what I had in mind, although you did get the first three words right.
"You have not provided enough context" ?

--
Bill Pursell

Sep 10 '06 #9
Simon Biber posted:
#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.

Lookup how a "for" loop works and all will become clear.

HINT: The conditional to be tested in the above snippet is always false.

--

Frederick Gotham
Sep 10 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.