用于 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
相关推荐
懂懂tty3 分钟前
Vue3 编译优化
前端·javascript·vue.js
低保和光头哪个先来9 分钟前
源码篇 生命周期
前端·javascript·vue.js
持敬chijing10 分钟前
Web渗透之SQL注入-盲注(布尔盲注,时间盲注)
前端·sql·oracle
坚果派·白晓明11 分钟前
鸿蒙PC三方库使用:使用 AtomCode + Skills 自动完成鸿蒙化三方库11Zip集成
c语言·c++·华为·harmonyos
凯瑟琳.奥古斯特14 分钟前
力扣1002题C++解法详解
开发语言·c++·算法·leetcode·职场和发展
钟灵92120 分钟前
C++【模板初阶】
开发语言·c++·笔记·c#
NGINX开源社区21 分钟前
NGINX Ingress Controller 中的 Cache Policy:VirtualServer 实战指南
java·前端·nginx
江屿风24 分钟前
【C++笔记】vector流食般投喂
开发语言·c++·笔记
CHHH_HHH26 分钟前
【C++】红黑树:比AVL树更实用的平衡二叉搜索树
开发语言·数据结构·c++·算法·stl
SoftLipaRZC28 分钟前
C语言文件:文件操作完全指南
android·java·c语言