Formatting differences between sprintf() and wsprintf() in VS2015
问题 I am moving some code from multibyte to unicode, and finding my string formatting coming out wrong. It looks like Visual Studio 2015 handles the width argument specifier '*' differently between sprintf() and wsprintf(). Is this a compiler bug or side-effect, or am I missing something really obvious? Code below, with output: char cOutA [ 64 ]; wchar_t wcOutA [ 64 ]; sprintf ( cOutA, "Multibyte = %.*f\n", 3, 2.12345 ); wsprintf ( wcOutA, L"Unicode = %.*f\n", 3, 2.12345 ); printf ( cOutA );