Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search
1 replies = new reply since forum marked as read
Highlight: NoneDon't highlight anything 5 newestHighlight 5 most recent replies
This is why you should never interrupt a programmer. (Original Post) Kermitt Gribble Nov 2013 OP
I'm not really sure what the colon means, I thought it was in the else branch jakeXT Nov 2013 #1

jakeXT

(10,575 posts)
1. I'm not really sure what the colon means, I thought it was in the else branch
Sat Nov 9, 2013, 10:26 AM
Nov 2013

(condition)?(evaluate if condition was true) : (evaluate if condition was false)

//Invalid in most programming languages. Two of the exceptions are Ruby and Scala
my_variable = if(x > 10) { "foo" } else { "bar" };
//Valid
my_variable = (x > 10)?"foo":"bar";

http://en.wikipedia.org/wiki/Conditional_%28computer_programming%29


I always used something like this

if (c == ',') {backtrack = 1;}
Latest Discussions»The DU Lounge»This is why you should ne...