user1391118
user1391118

Reputation: 265

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

Upvotes: 0

Views: 18756

Answers (1)

Jake
Jake

Reputation: 11430

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

Upvotes: 12

Related Questions