• Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple loop but icant figure it out?  RSS feed

 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This is rediculus - could someone please put me out of my misery?!?!?!

The while (a-- > 1) statement has confused me. I would have thought the ouput would be

Not

What am i misinterpreting here???

Cheers
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remember that a post-decrement operator has as its value the value of the variable before the decrement.
 
Sam Bluesman
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
O I C. Thank you.

Sorry about the double post. Had a problem browser.

Thanks again
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!