I've tried OutputDebugString function and most of the time I get error like :
error C2664: 'OutputDebugStringA' : cannot convert parameter 1 from 'int' to 'LPCSTR'
Examples
Attempt 1:
//ERROR: sprintf is unsafe. Use sprintf_s instead int x = 4; char s[256]; sprintf(s, "There is %d numbers", x); OutputDebugString((LPCWSTR)s); Attempt 2:
//FAIL: outputs junk (sprintf_s doesn't understand unicode?) int x = 4; char s[256]; sprintf_s(s, "There is %d numbers", x); OutputDebugString((LPCWSTR)s); Attempt 3:
//ERROR: no instance of overloaded function "sprintf_s" matches the argument list int x = 4; TCHAR s[256]; sprintf_s(s, "There is %d numbers", x); OutputDebugString((LPCWSTR)s); Attempt 4:
//ERROR: no instance of overloaded function "sprintf_s" matches the argument list int x = 4; TCHAR s[256]; sprintf_s(s, L"There is %d numbers", x); OutputDebugString((LPCWSTR)s); Attempt 5:
//ERROR: no instance of overloaded function "swprintf" matches the argument list int x = 4; TCHAR s[256]; swprintf(s, "There is %d numbers", x); OutputDebugString(s); Attempt 6:
//ERROR: 'swprintf': function has been changed to confirm with the ISO C standard, adding an extra character count parameter int x = 4; TCHAR s[256]; swprintf(s, L"There is %d numbers", x); OutputDebugString(s);