if (check) 和 if (check=1) 有区别么#include using namespace std;// a;check=func(a,&b,&c); if (check )不能输出正确内容 if(check=1)则能输出正确内容 cout

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/07 11:21:57
if (check) 和 if (check=1) 有区别么#include using namespace std;// a;check=func(a,&b,&c);  if (check )不能输出正确内容 if(check=1)则能输出正确内容  cout

if (check) 和 if (check=1) 有区别么#include using namespace std;// a;check=func(a,&b,&c); if (check )不能输出正确内容 if(check=1)则能输出正确内容 cout
if (check) 和 if (check=1) 有区别么
#include
using namespace std;// a;
check=func(a,&b,&c);
if (check )不能输出正确内容
if(check=1)则能输出正确内容
 cout

if (check) 和 if (check=1) 有区别么#include using namespace std;// a;check=func(a,&b,&c); if (check )不能输出正确内容 if(check=1)则能输出正确内容 cout
check=1是把1赋值给check,c/c++里比较相等是==,所以 if(check=1)与
check=1;
if(1)
.
效果是一样的
你这个会出错是因为你的函数func可能和系统存在的函数重名了,改一下函数名试试