Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://496744]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2025-05-12 02:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.