Skip to main content
gamedev.net
snprintf

snprintf

dcosborn
Journal of dcosborn ยท ยท 1 min read
612 0

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro โ€” $3/month.

Not much to say except that I got tired of hacking around issues with Microsoft's old implementation of snprintf, used by MinGW, so yesterday I set out to write my own. I've been closely following the official C99 spec, and I think I've got everything done except the e/E, G/g, and A/a specifiers and wchar_t support. In case anyone could use it, I'm releasing my implementation under the zlib license. It should integrate easily; just include after . If you make changes or bug fixes, consider sending them to me so I can update the original.

There's also the portable snprintf implementation; it targets a wider scope, beyond C99. I had trouble using it myself, but that seems to happen a lot so your mileage may vary.

Oh and I also just got back from Cuba a week ago. Was a nice vacation, stayed at a small resort, went to Havana. Good break from the computer.

Discussion

Loading comments...