跳到正文

个人记录

超实用代码前缀

cxm1024约 1 分钟
原文
文章信息与版本

文章信息

发布
2020年2月22日
收录
2025年12月12日
更新
2026年11月9日
篇幅
约 1 分钟
获赞
1

版本

  1. v1当前
C++
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<deque>
#include<utility>
#define DEBUG fprintf(stderr, "Passing function [%s] line %d\n", __FUNCTION__,__LINE__);
#define DE(sss) fprintf(stderr, "Passing function [%s] line %d  %s=", __FUNCTION__,__LINE__,#sss);cout<<sss<<endl;
using namespace std;
int main()
{
    return 0;
}
  • 在某一行输入 DEBUG(不用加分号),运行到那儿会输出当前所在函数和 DEBUG 所在的行号(调试用)
  • 在某一行输入 DE(···)(括号里是任意变量名)(不用加分号),运行到那儿不仅会有和 DEBUG 相同的效果,并输出这个变量当前的值(调试用)
原文