the error message is "invalid conversion from 'const char*' to 'char'"Code:int Y; char ett[10], out[50]; cin>>ett; Y = atoi(ett); atoi() Makes Y the string ett for(int x = 0; x < Y;x = x + 1){out[x] = "I";}
Other way I tried this was
" cannot convert 'std::string' to 'char' in assignment"Code:int Y; string I; I = "I"; char ett[10], out[50]; cin>>ett; Y = atoi(ett); for(int x = 0; x < Y;x = x + 1){out[x] = I;}
Can someone help me fix this, or change it to a way that it will work? The idea is to convert the number into the string so that, if I input 5, the result is IIIII.



LinkBack URL
About LinkBacks



