c语言中 MassageBox 问题
代码如下#include "stdafx.h"#include "stdio.h"
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
int ret= MessageBox(NULL," 你好吗?","提示",MB_YESNO|MB_ICONINFORMATION);
if(ret=IDYES)
MessageBox(NULL," 哈哈!","提示",0);
else
MessageBox(NULL," 怎么了","提示",NULL);
return 0;
}
我找到错误原因了 if(ret==IDYES)等号我写成了赋值
为什么写成if(ret=IDYES)就不管你是点是还是否都只弹 MessageBox(NULL," 哈哈!","提示",0); 而写成if(ret==IDYES)就正常了呢 这点我没想明白