Sign in to follow this  
Shmuel

wsprintf equivalent

Recommended Posts

I'm programming a game that uses SDL and I don't want to limit it to the windows platform by using any of the windows only functions. Teh book I'm using uses the function wsprintf, which is defined in windows.h. My question is: Is there a c or C++ function like wsprintf? I know about sprintf, but it doesn't append to the string does it? I wasn't sure about that.

Share this post


Link to post
Share on other sites
wsprintf is not a windows-only function, tho it is not a POSIX function. swprintf is more common on UNIX boxes. Note that the only substantial difference between wsprintf and sprintf is that wsprintf uses wide (international) characters.

Share this post


Link to post
Share on other sites
No, he means swprintf. It is part of the CRT, which should be with all C compilers.

int sprintf( char *buffer, const char *format [, argument] ... );
int swprintf( wchar_t *buffer, const wchar_t *format [, argument] ... );

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this