I am debugging some Windows Socket code and want to get the current WSAGetLastError () value from the Visual Studio 2013 debugger.
For example, I have a code:
fprintf(log, "WSAErrno = %d\n", WSAGetLastError());
and after this line I want to see the value (the log file is not reset, so I can not look there).
When I try to use Visual Studio 2013 (by typing this into the "Immediate Window"), I get
WSAGetLastError()
identifier "WSAGetLastError" is undefined
I know that I can change the code to
int wsaErrno = WSAGetLastError();
fprintf(log, "WSAErrno = %d\n", wsaErrno);
this is what I did as a job, but in some cases it is not recommended to change the code, recompile and reproduce the error.
source
share