用于 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
相关推荐
郭涤生9 小时前
std::condition_variable的使用及主要事项
开发语言·c++
悟乙己9 小时前
解析 Agent 时代的 HTML PPT SKILLS: html-ppt-skill
前端·html·powerpoint
ZC跨境爬虫9 小时前
跟着 MDN 学 HTML day_2:(表单分组与高级输入控件实战)
前端·javascript·css·ui·html
小菜鸡桃蛋狗9 小时前
C++——list
开发语言·c++
handler019 小时前
Git 核心指令速查
linux·c语言·c++·笔记·git·学习
fish_xk9 小时前
c++中的多态
c++
汉克老师9 小时前
GESP2025年6月认证C++五级( 第三部分编程题(1、奖品兑换))
c++·二分算法·gesp5级·gesp五级
学会去珍惜9 小时前
学会C语言可以做什么
c语言·网络编程·游戏开发·嵌入式系统·系统编程
Lhan.zzZ9 小时前
笔记_2026.4.28_003
c++·笔记·qt·opencv
stolentime9 小时前
我常常追忆过去
c++·里程碑纪念