Questions tagged as 'operador-ternario'

3
answers

Restrictions of the ternary operator ?:

I have this piece of code: (comprar >= 1 && comprar <= 40) ? ActualizarAsientos(Asientos, comprar) : cout << "Asiento fuera de rango"; Where the first condition is a void and the second one a text output, however...
asked by 15.04.2018 / 02:16
2
answers

PHP Ternary conditions

I was wondering if there was any way to perform a ternary codicional that only evaluates a true condition and not a false one. For example, the ternary conditional in php would be: $n = (2) ? true : false; My idea would be to make a tern...
asked by 09.07.2018 / 15:15