Stampare una variabile bool con printf

From RVM Wiki
Revision as of 15:37, 23 September 2009 by Gabriele.vivinetto (talk | contribs) (New page: Non esiste un formattatore per il tipo bool. Bisogna usare ilconditional operator per stampare la stringa giusta: bool married; married = false; printf("You are married: %s",(married)...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Non esiste un formattatore per il tipo bool.

Bisogna usare ilconditional operator per stampare la stringa giusta:

bool married;
married = false;
printf("You are married: %s",(married)?"true":"false");

Riferimenti