For some reason after coming back from years of not programming in C I cannot make this work:
(This compiles with no complain but it's causing a crash, when I remove the strcat line the executable runs fine)
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv){
char clibdir[50] = "C:\\Users\\______000\\Desktop\\nodeC\\libraries\\c";
char varsfile[20] = "\\variables.xml";
printf("%s\n", clibdir); //ok
printf("%s\n", varsfile); //ok
char *varspath = strcat(clibdir, varsfile); //this is provoking a crash
printf("%s\n", clibdir); //prints right before crash
printf("%s\n", varspath); //prints right before crash
return 0;
}
This prints just perfectly but it's crashing my exe. This is my command line (I'm using cl.exe from Visual Studio 2010):
"%vcbin%\vcvars32.bat" && "%vcbin%\cl.exe" /nologo /EHsc main.cpp /link /subsystem:console