jeudi 30 avril 2015

How to write one line and nested 'if' statement without '?:' (is it possible?)

Is it possible to write a one line if-else statement (i.e. only using one ;) without using the ?: expression? For instance something of the form: if (p == 1) " " else "\n";

Potential purpose could be: cout << if (p == 1) " " else "\n";

Just curious if this is possible, don't know if there are any practical applications for this.

Thanks

Aucun commentaire:

Enregistrer un commentaire