i am running a program on win 7 via visual studio 2008
and i am getting this error:
Error 4 error C3861: 'snprintf': identifier not found
i have included stdio header...
i don't know what else it can be missing
i am running a program on win 7 via visual studio 2008
and i am getting this error:
Error 4 error C3861: 'snprintf': identifier not found
i have included stdio header...
i don't know what else it can be missing
Looks like on Windows, the function is prefixed with a _. Also, the function is deprecated in favour of a safer one:
http://msdn.microsoft.com/en-us/library/2ts7cx93(v=vs.80).aspx
snprintf_s
is rather stupid, snprintf
already takes the size of the buffer, what benefit does asking for it twice have? If you don't want to fill the entire buffer, just give a smaller size!
snprintf
is a standard C function (new in C99). Microsoft's "deprecation" of it in favor of non-standard functions is highly questionable.
Jan 29, 2012 at 9:51
_
on Windows. It's not the same function; _snprintf
is not compliant with the C99 requirements for snprintf
. In particular, _snprintf
does not guarantee NUL-termination and does not return the necessary buffer size if a larger buffer is required.
Jan 29, 2012 at 10:34
snprintf
and vsnprintf
are added with C99 standard support in VS2014. See blogs.msdn.com/b/vcblog/archive/2014/06/18/….
Oct 29, 2014 at 23:10