I create a TCHAR array as follows:
unsigned int size = sizeof(working_path) + sizeof(TEXT("\\")) + sizeof(filename) + 1; TCHAR old[size]; _tcscat(old, working_path); _tcscat(old, TEXT("\\")); _tcscat(old, filename); old[size] = '\0'; In the program, I specify the working_path as C:\Intel\Logs for example. In the debug window on the third line, I put a breakpoint and see that old already has the value \fЁ›*юяяяЂШ&w…3)w . In the Eclipse settings, the encoding is set to utf-8
Maybe you need to somehow reset after creation?
*cat(old, ...)should be*cpy(old, ...). Or it is necessary to put a zero in the first character ofoldbe forced before concatenation. There's also default garbage. - αλεχολυτTCHAR old[size] = "";I don’t know if it’s right, but it worked. Just did as you advised. Generally, am I the right size and the like? - HerrgottTEXT(). You can still like this:TCHAR old[size] = {};.sizeStandard must beconst, by the way (gcc eats because of the support of variable length arrays (VLA)). - αλεχολυτTCHAR old[size] = {0,};so, or soold[0]=0in front of all cat, because the default memory is not clean. - nick_n_a