Silly sprintf question
Silly sprintf question
I'd like to know if I should be using _sprintf or sprintf in my code? I want my current game to cross platform, but I don't know if Mac or Linux uses the secure versions of sprintf or stricmp. Haven't bought my Mac for development yet.
George A Lancaster
I don't think _sprintf exists on other platforms, this looks like a MS specific extension (and man - do I hate all the warnings they added for the old versions as lots of libs out there don't use pragmas to disable them and so compiling with VS can produce hundreds of warnings these days!).
The safest way to work (and which is platform independent) is anyway to use c++ streams instead of sprintf, but I admit that I also still often use the printf stuff.
The safest way to work (and which is platform independent) is anyway to use c++ streams instead of sprintf, but I admit that I also still often use the printf stuff.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm