首页 > 代码库 > assert

assert

#define NDEBUG
#include <assert.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
    assert(0);
    printf("%s\n", argv[argc - 1]);//路径到.exe
    printf("%s\n", __FILE__);//路径到.c
    printf("%d\n", __LINE__);//__LINE__所在的行数
    return 0;
}