View Single Post
  #12   Spotlight this post!  
Unread 15-02-2006, 11:42
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: A few simple programming questions;

Quote:
Originally Posted by aaeamdar
Neat but terrible shorthand (don't do this):

x += x < 100;

Which does? I throw it out there.
Ooh, clever. Dangerous, but clever. It increments x unless it's already 100 or greater.
Code:
if (x < 100)
    x = x + 1;
It's true, C does give you enough rope to shoot yourself in the foot.