6
Possible Duplicate:
How to convert a number to string and vice versa in C++size_t convert/gettato in stringa in C++
Dow faccio a convertire un valore fondamentale per un string
in C++?
Questo è quello che ho provato:
for(size_t i = 0;vecServiceList.size()>i;i++)
{
if (! vecServiceList[i].empty())
{
string sService = "\t" + i +". "+ vecServiceList[i] ;
}
}
E qui è l'errore:
invalid operands of types 'const char*' and 'const char [3]' to binary 'operator+'
@CodyGray, cercavo per questo, grazie. – chris
la mia prima ipotesi è che tu abbia bisogno di qualcosa, ad es. boost: format ("% lu")% i, ma quale era l'errore? – guinny
'std :: to_string ((int) var)' – refi64