Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^4: If I was forced to use only one kind of loop for the rest of my days it would be a

by ambrus (Abbot)
on Oct 02, 2005 at 13:10 UTC ( #496744=note: print w/replies, xml ) Need Help??


in reply to Re^3: If I was forced to use only one kind of loop for the rest of my days it would be a
in thread If I was forced to use only one kind of loop for the rest of my days it would be a

In fact, I belive

for(int a = 0; a<10; a++) { printf("%d\n",a); }
is equivalent to
{ int a = 0; while(a<10) { printf("%d\n",a); a++; }
Your other code,
{ int a = 0; while(a++,a<10) { printf("%d\n",a); } }
doesn't run the printf statement with a = 0.
  • Comment on Re^4: If I was forced to use only one kind of loop for the rest of my days it would be a
  • Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://496744]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2019-06-17 16:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (80 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!