Liberty Unleashed
Off Topic => General Chat => Topic started by: Romop5 on November 04, 2011, 04:08:16 pm
-
For example I have:
char chError[] = "Your PC is low";
int iErrorId = 55;
And I want write it on screen by MessageBox:
MessageBox(NULL, "Error iErrorId: chError","Error",MB_OK);
How can I code it correctly ?
Thanks
Btw: I know that I can't get iErrorId between ""
-
I'm presuming your working from C++ here? Based off that assumption...
#include <stdio.h>
char szError[] = "Your PC is low";
int iErrorID = 55;
char szErrorMessage[25];
sprintf( szErrorMessage, "Error %d: %s", iErrorID, szError );
MessageBox( NULL, szErrorMessage, "Error", MB_OK );