This is valid source code:
// ... unsigned __int64 num = 57; sprintf_s(buffer, sizeof(buffer), "%llu", num);
However, when I try to extract this part into this function:
void addBuffered(void** attributeValue, char* format) { sprintf_s(buffer, sizeof(buffer), format, *attributeValue); }
causing:
addBuffered((void**)&num, "%d");
I need to change the format parameter in sprintf_s from %llu to %d to get the correct value. Can someone explain why this is happening, and is there a problem with changing the parameter to %d ? Thanks!
source share