为什么断言不做任何事情?我需要做什么才能让它工作?

时间:2021-05-06 22:51:44

标签: c cuda

#include <iostream>
#include <assert.h>
using namespace std;


int main() {
    assert(1 == 0);
    assert(false);

    cout << "we got here" << endl;

    return 0;
}

使用上面的代码,we got here 被输出到控制台窗口。

另外,我注意到 assert 被定义为:

#define assert(expression) ((void)0)

不再精通 C/C++,而 CUDA C 也差不多。

0 个答案:

没有答案
相关问题