Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ QT 4.8普通比较时的碰撞_C++_Qt_Crash - Fatal编程技术网

C++ QT 4.8普通比较时的碰撞

C++ QT 4.8普通比较时的碰撞,c++,qt,crash,C++,Qt,Crash,请帮我解释一下意外事故!!! 我有: x、 h ……等等 x、 cpp 如果((bitmap.S2L\u NOTIFY.mono.state==3))-

请帮我解释一下意外事故!!! 我有:

x、 h

……等等

x、 cpp

如果((bitmap.S2L\u NOTIFY.mono.state==3))
-<此处不崩溃

如果((bitmap.S2L\u NOTIFY.color.state==3))
-<此处不崩溃


请告诉我哪里错了或编译器错了?

问题是您的条件中有x,但函数
x::rndfunc()
是类x的成员函数。。。不是一个变量。应该是:

// "this" refers to the current instance of class x
if((this->y.z.f.nmb2 == NOTOK) && (this->y.z.f.nmb1 == NOTOK))
或者简单地说:

// but the "this" isn't actually necessary
if((y.z.f.nmb2 == NOTOK) && (y.z.f.nmb1 == NOTOK))
(如你所写)

编辑:好的,原来的问题中有一个输入错误,因此上面的内容不再相关。新的答案是:

f
没有成员变量
nmb1
,只有
nmb2

编辑#2:更多打字错误。我的新答案是:


你想做的事情看起来很混乱。不要这样做。

你能在
valgrind
或其他调试器下运行你的程序吗?你至少应该发布一个编译的代码。。您提供的是foobar。如果((this->y.z.f.nmb2==NOTOK)和(&(this->y.z.f.nmb1==NOTOK))是我的打字错误,程序仍然不起作用。@那么nmb1不是f的成员变量(而是h)这不是问题吗?这是调试模式错误!所以我试着在调试模式下调试我的其他bug,这个比较bug阻止了我。p、 美国调试模式错误?!洛威尔,很高兴你明白了!
// "this" refers to the current instance of class x
if((this->y.z.f.nmb2 == NOTOK) && (this->y.z.f.nmb1 == NOTOK))
// but the "this" isn't actually necessary
if((y.z.f.nmb2 == NOTOK) && (y.z.f.nmb1 == NOTOK))