用于 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
相关推荐
Non-existent9871 小时前
海拔批量查询 + 批量 KML 生成工具-WPS 插件 TableGIS 新功能
javascript·c++·excel·wps
咩咦8 小时前
C++学习笔记28:静态成员应用:不用循环求1到n的和
c++·学习笔记·类和对象·static·构造函数·oj·静态成员
EllinY8 小时前
CF2217E Definitely Larger 题解
c++·笔记·算法·构造
ZC跨境爬虫9 小时前
跟着 MDN 学CSS day_16:(深入掌握背景与边框的艺术)
前端·css·ui·html·tensorflow
筠筠喵呜喵9 小时前
Linux软件开发性能优化
linux·c++·性能优化
Bruce_kaizy10 小时前
c++ linux环境编程——文件io介绍以及open 、write 、read 三剑客深度详解
linux·服务器·c++·ubuntu·操作系统·文件io
道里11 小时前
花了 5 万刀用 AI 写代码之后,这是我的全部经验
前端·人工智能
PAK向日葵12 小时前
我用 C++ 写了一个轻量级 Python 虚拟机,刚刚开源
c++·python·开源
玖釉-12 小时前
下一个排列:从字典序到原地算法的完整推导
数据结构·c++·windows·算法
Royzst12 小时前
xml知识点
java·服务器·前端