Sending a number to a control

i want to send a number to a control for example:
int number = 50;
SetDlgItemText( hDlg, IDC_STATICTEXT1, number );
i know that wont work, so whats the right way to do it? would i convert it to char * first? if so please show me exactly how.
im using the windows api, borland c++ 5.02, and win95.
thanks.
chris
VickioAsked:
Who is Participating?
 
sergemConnect With a Mentor Commented:
char szText[255];

sprintf(szText,"%i",number);
SetDlgItemText(hDlg,IDC_STATICTEXT1,szText);
0
 
VickioAuthor Commented:
thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.