• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A simple question

 
danesh far
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,could you please let me know what the following ststement says:

theDX = theDX > MAX_V ? MAX_V : theDX;
[ December 09, 2004: Message edited by: Ernest Friedman-Hill ]
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I edited your post to remove some superfluous formatting.

The ? and : characters together are the "ternary operator." It's basically a shorthand way of writing "if/then". Another way to write exactly the same thing would be



Of course, written out like this, the "else" part is redundant.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic