This is a problem today: (I use vs2008)
Code:
swprintf( tempwcX, L"%s", tempStrX.c_str());
Error:
D: \ Visual Studio 2008 \ projects \ testregex. CPP (53): Warning c4996: 'swprintf': swprintf has been changed to conform with the iso c standard, adding an extra Character Count parameter. to use traditional Microsoft swprintf, SET _ crt_non_conforming_swprintfs.
1> D: \ Program Files \ Microsoft Visual Studio 9.0 \ Vc \ include \ swprintf. INL (85): see the "swprintf" statement.
I did not find the specific reason for various searches on the Internet, and then I returned to msdn. I saw the following sentence:
In Visual C ++ 2005, swprintf conforms to the iso c standard, which requires the second parameter, count, of Type
Size_t. To force the old nonstandard behavior, define_crt_non_conforming_swprintfs. In a future version, the old behavior may be removed, so code shocould be changed to use the new conformant behavior.
(IN Vc ++ 2005, swprintf follows the International Standards Organization standard C and requires the second size_t type count ........ In later versions, old behaviors will be removed, so the code should use new consistent behaviors. (If the translation is poor, let's take a look ...)
Therefore, you can ignore this error directly. If you see this warning uncomfortable, you can add a parameter count, for example:
swprintf( tempwcX, 100, L"%s", tempStrX.c_str());
Tested by myself, warning is gone.