![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c/c++
清风迷人
这个作者很懒,什么都没留下…
展开
-
c/c++ 可变参数运用
c/c++ 可变参数运用#include <stdarg.h>#include <iostream>#include <string>using namespace std;enum LogLevel//日志等级{ LEVELERROR = 0, LEVELWARNNING, LEVELDEBUG};void PrintLog(LogLevel level, string strFormat, ...){ string strLevel = "原创 2020-05-25 21:48:07 · 111 阅读 · 0 评论 -
宏定义中#和##使用
宏定义中#和##使用#include <iostream>#define PRINT(A) printf("%s : %d\n", #A, A) //#在宏定义中是把后面的参数转换成字符串#define _CONV_(A,B) A##B //##在宏定义中是把前后两个参数连接起来#define CONV(A,B) _CONV_(A,B)#define SHAPE Squareclass CShape{public: virtual vo原创 2020-05-25 21:31:48 · 374 阅读 · 0 评论 -
c/c++获取时间函数
c/c++获取时间函数1.使用windows API#include <windows.h>#include <stdio.h>int main(int argc, char* argv){ //windows API获取时间 SYSTEMTIME p; GetLocalTime(&p); char ch[50]; sprintf_s(ch, "%04d-%02d-%02d %02d:%02d:%02d,%03d", p.wYear, p.wMont原创 2020-05-25 20:52:36 · 445 阅读 · 0 评论