Devo concatenare una stringa e una variabile nel risultato di un operatore ternario:
Mi restituisce errore perché considera "<<" come shift binario.codice:cout<<(a?(a<<" anni"):"nulla")<<endl;
Come posso fare?
Devo concatenare una stringa e una variabile nel risultato di un operatore ternario:
Mi restituisce errore perché considera "<<" come shift binario.codice:cout<<(a?(a<<" anni"):"nulla")<<endl;
Come posso fare?
codice:( (a) ? cout << a << "anni" : cout << "nulla" ) << endl;
This code and information is provided "as is" without warranty of any kind, either expressed
or implied, including but not limited to the implied warranties of merchantability and/or
fitness for a particular purpose.