Calculator program

Hello all..
I am very thankful for the support from you. Now i am working on a calculator program on win32. So I need to convert the value from int to WCHAR. please help me.

Regards
ToNy
You could you the function _itow_s(...).

For the documentation see here: http://msdn.microsoft.com/en-us/library/0we9x30h%28v=vs.80%29.aspx

1
2
3
4
5
6
#define MAXLEN 5          //defines the length of the character array
WCHAR sBuffer[MAXLEN];    //wchar array to hold the converted number

int nValueToConvert = 10; //the integer value to convert

_itow_s(nValueToConvert, sBuffer, MAXLEN, 10);    //the _itow_s being invoked 


I'm sure there is a better way to do this by using wstringstream (documentation here: http://msdn.microsoft.com/en-us/library/3e8f34fb%28v=vs.80%29.aspx ), but I leave that to you.

I hope this helps.
Topic archived. No new replies allowed.