MFC中AfxMessageBox显示变量

显示int

int int_value = 2018;          //int_value为需要现实的int值
CString temp_value = _T("");   //temp_value用来处理int值
temp_value.Format(_T("%d"), int_value);//固定格式
AfxMessageBox(temp_value);

显示float

long float float_value = 2018.2018;   //float_value为需要现实的float值
CString temp_value = _T("");   //temp_value用来处理float值
temp_value.Format(_T("%f"), float_value);//固定格式
AfxMessageBox(temp_value);
发布了99 篇原创文章 · 获赞 27 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/qq_44391957/article/details/103753693
今日推荐