Entonces tengo esto:
char uloginName = "derp"; char mew = "home/home/" << uloginName << "\0";
I am trying concatinate uloginName with the rest of the string that will later be converted to an array of char. But it keeps returning me an error. I don't know how to do it. Also, I must use only char type as of this moment; No string.
Gracias por la ayuda.
preguntado el 01 de febrero de 12 a las 01:02
char uloginName="derp"; char mew="home/home/"; strcat(mew, uloginName);
Puede usar el
strcat on arrays of characters, so long as there is sufficient space and they are terminated with a zero byte.
Parece que estás buscando
std::ostringstream, which is a versatile and far less error-prone way of handling strings in C++.
strncat and their kin are hangovers from
C and should be used cautiously in C++.
char uloginName = "derp"; std::ostringstream mew; mew << "home/home/" << uloginName;