利用MessageBox输出变量有以下几种方法: char buf[20]; int n=95555; sprintf(buf,"%d",n); MessageBox(buf,NULL,MB_OK); int n=95555; CString b; b.Format("输出变量%d",n); MessageBox(b); wchar_t: int n=95555; CString b; b.Format(L"输出变量%d",n); MessageBox(b);