I am writing some code and one of the libraries I am using required a newer version of MINGW, i am using the latest codeblocks and have the one bundled with CB and I downloaded MINGW 3.1 x64 and x32, I have a 64 bit Win10 machine.
I pulled this (because I thought I was going mad) sample code from the web:
char str[] ="- This, a sample string.";
char * pch;
printf ("Splitting string "%s" into tokens:n",str);
pch = strtok (str," ,.-");
while (pch != NULL)
{
printf ("%sn",pch);
pch = strtok (NULL, " ,.-");
}
hit the run button , compiles all ok, as soon as it hits the printf(“%sn”, pch) it crashes, after some faffing around, if I change it back to the original compiler (the one bundled with CB) or the 13.1 x32 it runs absolutely fine, but 13.1 x64 just bails.
Anybody got any ideas? It doesn’t matter if it’s in debug or release mode.
Cheers
I was expecting it to work like it does on other compilers, tried debug, release
BagOfTricks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.