About 2,820,000 results
Open links in new tab
  1. How do I use the conditional (ternary) operator? - Stack Overflow

    The ternary operator ? is a way of shortening an if-else clause, and is also called an immediate-if statement in other languages (IIf(condition,true-clause,false-clause) in VB, for example).

  2. What is the Java ?: operator called and what does it do?

    It's a ternary operator (in that it has three operands) and it happens to be the only ternary operator in Java at the moment. However, the spec is pretty clear that its name is the conditional operator or …

  3. How do you use the ? : (conditional) operator in JavaScript?

    Jun 7, 2011 · What is the ?: (question mark and colon operator aka. conditional or "ternary") operator and how can I use it?

  4. What is a Question Mark "?" and Colon ":" Operator Used for?

    Apr 26, 2012 · This is the ternary conditional operator, which can be used anywhere, not just the print statement. It's sometimes just called "the ternary operator", but it's not the only ternary operator, just …

  5. What does the question mark character ('?') mean in C++?

    In regular code, it's syntactic sugar, but it does enable you to do conditional initialization in the initialization list of the constructot.

  6. syntax - What are the PHP operators "?" and - Stack Overflow

    Conditional operator ? : is an operator which is used to check a condition and select a value depending on the value of the condition. It is expressed in the following form:

  7. c# - ?: ?? Operators Instead Of IF|ELSE - Stack Overflow

    43 The ternary operator (?:) is not designed for control flow, it's only designed for conditional assignment. If you need to control the flow of your program, use a control structure, such as if / else.

  8. What is the difference between logical and conditional AND, OR in C# ...

    Oct 24, 2014 · I prefer to think of it as "bitwise vs. conditional" rather than "logical vs conditional" since the general concept of "logical" applies in both cases.

  9. What is the idiomatic Go equivalent of C's ternary operator?

    Nov 14, 2013 · The C conditional expression (commonly known as the ternary operator) has three operands: expr1 ? expr2 : expr3. If expr1 evaluates to true, expr2 is evaluated and is the result of the …

  10. if statement - ternary operator in matlab - Stack Overflow

    Apr 8, 2011 · MatLab doesn't have a ternary operator, or any other syntactic sugar for one-line if-statements. But if your if-statement is really simple, you could just write it in one line anyway: