The original article focuses on msdn documentation. It is also the previous version. I wonder if the new version has changed. After installing vs2013 Express, try again.
The main problem with this function is that it is not defined in the C standard and provided by various manufacturers themselves. GCC provides snprintf, and Ms provides a version with a prefix underscore. Therefore, there is no standard definition of function behavior, and there is a difference in implementation. It is mainly manifested in the returned value and the behavior of the output buffer.
The GCC version automatically adds "\ 0" to the end of the target string when the source string length is greater than or equal to size. The returned value is the source String Length;
If the source string length is greater than or equal to size, "\ 0" is not automatically added to the end of the target string. If the returned value exceeds the size, a negative value is returned;
In contrast, the GCC version is safer.
It seems that there are few things without a standard definition to be used, so it may be difficult to get stuck if you don't know. Maybe the c Standard Committee will include snprintf into the standard one day, so the implementation of one of them will definitely have to be changed.
Snprintf/_ snprintf function differences between different platforms