[OT]-"sprintf_s()" - (C) & (R) Symbol Characters?

[OT]-“sprintf_s()” - © & ® Symbol Characters?

Hi,

I was using Code::Blocks on Windows to build our game.
I recently changed to Microsoft Visual Studio Express 2013.

I’ve got everything working except the following:
I can’t seem to print © and ® symbol characters?

Here is the code:

Code:
char *copy = new char[2];
sprintf_s(copy, “%c”, 0xA9); //<- error C2664: ‘int sprintf_s(char *,size_t,const char *,…)’ : cannot convert argument 2 from ‘const char [3]’ to 'size_t’
strcpy_s(visuals->VariableText, copy);

Any help would be appreciated, thanks!------------------------
JeZxLee
JessePalser <AT> GMail <DOT> com
16BitSoft Inc.
Video Game Design Studio
www.16BitSoft.com

Probably because that’s not how you call sprintf_s. From the VS2013 help:
int sprintf_s( char *buffer, size_t sizeOfBuffer, const char *format [,
argument] … );

As you can see, the second parameter is supposed to be the length of the
buffer, but you’re omitting it entirely. The error message you quoted even
shows you the parameter list for the function.On Wed, Apr 22, 2015 at 11:42 AM, JeZ-l-Lee < JessePalserMailingLists at gmail.com> wrote:

[OT]-“sprintf_s()” - © & ® Symbol Characters?

Hi,

I was using Code::Blocks on Windows to build our game.
I recently changed to Microsoft Visual Studio Express 2013.

I’ve got everything working except the following:
I can’t seem to print © and ® symbol characters?

Here is the code:

Code:

char *copy = new char[2];
sprintf_s(copy, “%c”, 0xA9); //<- error C2664: ‘int sprintf_s(char
*,size_t,const char *,…)’ : cannot convert argument 2 from ‘const char
[3]’ to 'size_t’
strcpy_s(visuals->VariableText, copy);

Any help would be appreciated, thanks!


JeZxLee
JessePalser GMail com
16BitSoft Inc.
Video Game Design Studio
www.16BitSoft.com


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org