Microsoft _stprintf warning

Posted by mnh on Stack Overflow See other posts from Stack Overflow or by mnh
Published on 2009-08-18T13:34:57Z Indexed on 2010/05/08 12:58 UTC
Read the original article Hit count: 271

Filed under:
|
|

Why I get the following warning for the following code :)

Code:

_stprintf(m_szFileNamePath,_T("%s"),strFileName);

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.

I know _strprintf is a macro which if _UNICODE is defined will evaluate to _swprintf else it will be sprintf.

Now what is this _swprintf. There is a function swprintf, but why is _stprintf evaluating to _swprintf instead of swprintf.

What is the difference b/w the _xxx and xxx functions?

EDIT:

Okay there are two definitions for the UNICODE version of _stprintf, which one is included?

The one in tchar.h or strsafe.h?

© Stack Overflow or respective owner

Related posts about sprintf

Related posts about c++