MessageBox(&my_char, "Corrupt?", MB_ICONQUESTION | MB_OK);
Elfman wrote: Hi i hope some can help me i need to out put a varible in a message box so i can see where the value is being corrupted it's a char[15] , i'm using visual c++ 6.0 thanks
char my_char[15]; /* code to initialise and corrupt my_char goes here */ /* Remove the & from earlier suggestion. */ MessageBox(my_char, "Corrupt?", MB_ICONQUESTION | MB_OK);
Evil Phil wrote: Soz, I thought LPCTSTR meant it required a pointer. My bad.
////////////////////////////////////////////////////////////////////////////// // FUNCTION : DisplayChars // // PURPOSE : // ////////////////////////////////////////////////////////////////////////////// void CClassName::DisplayChars() { char buff[128]; char MyChar[] = "How much wood could a would chuck chuck if a wood chuck could chuck chukwa"; // Display messagebox for char[15] wsprintf(buff, "char 15 = %c", MyChar[15]); MessageBox(buff, "Character Number 15", MB_OK); // Or you can Loop through all the characters for(int i=0; i < strlen(MyChar); i++) { wsprintf(buff, "char pos %d = %c\\nPress yes to continue", i, MyChar[i]); if(MessageBox(buff, "Character Loop", MB_ICONQUESTION | MB_YESNO) == IDNO) break; } }