appeneding another value into a parameter
im trying to put a varible into a parameter with a char * varible as well.
Code:
int i(5);
MessageBox(ghwnd_Main,(LPCSTR)sprintf("Hey this is my number %a",(LPCSTR)i),"",MB_OK);
it compiles with these warnings
Quote:
c:\C++\winControls\winControls.cpp(51): warning C4312: 'type cast' : conversion from 'int' to 'LPCSTR' of greater size
c:\C++\winControls\winControls.cpp(51): warning C4312: 'type cast' : conversion from 'int' to 'LPCSTR' of greater size
but at run time it gives me this.
Quote:
Unhandled exception at 0x0041ffe6 in winControls.exe: 0xC0000005: Access violation reading location 0x00000005.
cheers :)