用于 C/C++ Debug 的宏函数

Debug.h

用于打印 Debug 信息的小工具:

c 复制代码
#pragma once

#include <stdio.h>

#define DEBUG 1

#define pn puts("")
#define where printf("%s(%d)-<%s>.\n\n", __FILE__, __LINE__, __FUNCTION__)

#if (DEBUG == 1)
#define print_error(fmt, ...)                                       \
	{                                                        		\
        printf(fmt "some error message.\n", __VA_ARGS__); 			\
        where;                                                      \
    }
#else
#define print_error(fmt, ...) 		\
    {                            	\
        printf(">");             	\
        fflush(stdout);          	\
    }
#endif
相关推荐
exm-zem1 小时前
从C语言到C++:C++入门1
c语言·c++
不简说1 小时前
JS 代码技巧 vol.4 — 10 个异步并发控制,Promise.all 这帮兄弟的踩坑实录
前端·javascript·面试
fpcc1 小时前
数据结构和算法—数学的应用
数据结构·c++·算法
Sinclair1 小时前
安企CMS的安装-PHPStudy(小皮面板)部署
前端·后端
皓月斯语1 小时前
B4451 [GESP202512 四级] 建造 题解
数据结构·c++·算法·题解
小喻同学i1 小时前
std::thread函数参数传递
开发语言·c++
会飞的特洛伊1 小时前
IAM身份认证
前端·后端
钛态2 小时前
AI 组件生成评测:别只看页面能不能渲染
前端·vue·react·web
Hyyy2 小时前
requestAnimationFrame和setTimeout有什么不同
前端
Jackson__3 小时前
问到你想清楚,这个 skill 专治没想明白就写代码!
前端·github·ai编程