- 博客(2)
- 资源 (3)
- 收藏
- 关注
转载 #、##、__VA_ARGS__和##__VA_ARGS__的作用
一、#用来把参数转换成字符串例子一:#define P(A) printf("%s:%d\n",#A,A);int main(int argc, char **argv){int a = 1, b = 2;P(a);P(b);P(a+b);system("pause");}输出为:例子二:#define SQUARE(x) printf("The square ...
2020-09-27 17:18:37 445
转载 关于vsnprintf的一些总结
函数声明:int vsnprintf(char *str, size_t size, const char *format, va_list ap);关于该函数各个参数的具体意义不再赘述,参见百度百科即可,下面仅对该函数使用过程中的一些细节或者注意点进行说明。#include <stdio.h>#include <stdarg.h>#define MAXLEN 10int mon_log(char* format, ...){ char str_tmp
2020-09-27 17:13:23 1285
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人