简体   繁体   中英

convert int to char * in C++

I want to convert an int to char *

char str[10]=;
int i=567;

str=itoa(i, str, 10)

This gives an error on str the third line

str must have a modifiable lvalue

char str[10]; 
int i=567; 
itoa(i, str, 10);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM