I've been getting "0xC0000005: Access violation reading location errors" in Visual Studio on Windows with a C/C++ program and have attempted to simplify to illustrate my question. The code below runs just fine:
char tmp[1000];
ULONG64 val1 = 1;
sprintf_s(tmp, 1000, "%lu, %s, %s", val1, "true", "false");
However, when I add an extra unsigned long to the format, I get an access violation, like with the code below:
char tmp[1000];
ULONG64 val1 = 1;
ULONG64 val2 = 2;
sprintf_s(tmp, 1000, "%lu, %lu, %s, %s", val1, val2, "true", "false");