`
rocky2com
  • 浏览: 38657 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

取得宏展开#define TO_STRING( x ) TO_STRING1( x ) #define TO_STRING1( x ) #x

 
阅读更多

#define TO_STRING( x ) TO_STRING1( x )
#define TO_STRING1( x ) #x
TO_STRING首先会将x全部展开(如果x也是一个宏的话),然后再传给TO_STRING1转换为字符串,现在你可以这样:
const char *str = TO_STRING( PARAM( ADDPARAM( 1 ) ) );去一探PARAM展开后的样子

分享到:
评论

相关推荐

    cJSON源代码,包含cJSON.c和cJSON.h 共2个文件 h:1个 c:1个

    #define cJSON_True 1 #define cJSON_NULL 2 #define cJSON_Number 3 #define cJSON_String 4 #define cJSON_Array 5 #define cJSON_Object 6 #define cJSON_IsReference 256 #define cJSON_StringIsConst 512 /*...

    课程设计 文件系统

    #include<string.h> #include #define DIR_LENGTH 1024 /*路径最长可达100字节*/ #define MAX_WRITE 1024*128 /*写入文字可达128k字节*/ #define MEM_D_SIZE 1024*1024 /*1M磁盘空间*/ #define DISKSIZE 1024 /*...

    CheckSystemVersion

    #define OS_WIN95 1 #define OS_WIN98 2 #define OS_WINME 3 #define OS_WINNT4 4 #define OS_WIN2K 5 #define OS_WINXP 6 #define OS_WIN_VISTA 7 #define OS_WIN_7 8 #define OS_WIN_SERVER_2003 9 #define OS_WIN...

    学生管理系统代码C语言

    #define FUNC_NEW 1 /* 建立新的班级学生数据*/ #define FUNC_SAVE 2 /*把数据写入文件并保存*/ #define FUNC_OPEN 3 /*打开文件并从里读入数据*/ #define FUNC_INSERT 4 /*插入一个学生的信息*/ #define FUNC_...

    linux内核指导相关源代码

    #ifndef __KERNEL__ #define __KERNEL__ #endif #ifndef MODULE #define MODULE #endif #define __NO__VERSION__ ...//MODULE_PARM(var,type)模块参量的类型代码: b=byte h=short i=int l=long s=string

    51单片机实现的RS485通讯程序

    #include <string.h> #define unsigned char uchar #define unsigned int uint /* 通信命令 */ #define __ACTIVE_ 0x01 // 主机询问从机是否存在 #define __GETDATA_ 0x02 // 主机发送读设备请求 #define __OK_ 0x...

    linux 函数时间统计 打印

    #include <string> #include #include #include #include #define NS_TT_START namespace tt { #define NS_TT_END } #ifdef __TIME_TRACE_DEBUG__ # define TIME_TRACE tt::record Tt_ReCoRd_AvOiD_ReDeF(new...

    51单片机实现的485通讯程序

    #include <string.h> #define unsigned char uchar #define unsigned int uint /* 通信命令 */ #define __ACTIVE_ 0x01 // 主机询问从机是否存在 #define __GETDATA_ 0x02 // 主机发送读设备请求 #define __OK_ 0x...

    数据结构C语言描述的源码

    数据结构 c语言描述的源码 头文件:/* * filename: dsdef.h * description: This head file includes ...#define __STRING_H__ #endif #if !defined(__DSDEF_H__) #define __DSDEF_H__ 。。。。。。。。。。。。。

    nokia 5110 MSP430 G2553 显示程序 好用

    BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; LCD_init(); /* 初始化显示器的设置 */ LCD_clear(); /* 清除所有显示 */ LCD_write_english_string( 0, 0, "TIZHICESHI" );//第一排显示 LCD_write_english_...

    操作系统原理课程设计报告

    control.c #include #include #include #include #include #include <string.h> ...#define SEMKEY_full1 9086 #define SEMKEY_full2 9087 #define SEMKEY_mux 9088 #define BUFF_LEN 5 /*缓冲区可以存放个水果*/

    C语言编写的推箱子游戏源码

    #include<string.h> #include<stdlib.h> #include<bios.h> #include<graphics.h> #include<conio.h> #include <alloc.h> #include<time.h> #include <math.h> #define MAX 3 #define STEPMAX 3 #define ...

    Binl_Server.zip

    /* * Mini Binl Server ... * * This program is free software;...#define INVALID_SOCKET -1 #define SOCKET_ERROR -1 #define closesocket close #define WSAGetLastError() errno #define WSACleanup

    电子画板程序

    #include <string.h> #include #pragma import(__use_no_semihosting_swi) // ensure no functions that use semihosting //const U32 Line_Button_ID=100; //const U32 Circle_Button_ID=101; //const U32 Curve_...

    错误Amr文件修复

    #define AMR_MAGIC_NUMBER "#!AMR\n" #define MAX_AMR_FRAME_SIZE 32 #define AMR_FRAME_COUNT_PER_SECOND 50 int amrEncodeMode[] = {4750, 5150, 5900, 6700, 7400, 7950, 10200, 12200}; // amr 编码方式 #ifndef...

    用c语言实现的shell解释器

    #include <string.h> #include #include #include #define MAX_HOST_LEN 32 /* 主机名最大长度 */ #define MAX_PATH_LEN 256 /* 路径的最大长度 */ #define MAX_COMMAND_LEN 256 /*命令的最大长度*/

    stl_algobase.h

    #define __SGI_STL_INTERNAL_ALGOBASE_H #ifndef __STL_CONFIG_H #include <stl_config.h> #endif #ifndef __SGI_STL_INTERNAL_RELOPS #include <stl_relops.h> #endif #ifndef __SGI_STL_INTERNAL_PAIR_H #include...

    用c语言实现的逆序文本程序

    #include <string.h> #include #include #include #define MAX_HOST_LEN 32 /* 主机名最大长度 */ #define MAX_PATH_LEN 256 /* 路径的最大长度 */ #define MAX_COMMAND_LEN 256 /*命令的最大长度*/

    C语言实现简单航班管理系统

    #include <string> #include #include #define PERSON_MAXNUM 100 #define PERSONNOTICKET_MAX 10 #define MAX_SIZE 10 int _size = 0; int _person_size = 0; int _personnoticket_size = 0; //定义航班信息结构体 ...

    linux基于多进程的socket通信

    #include <string.h> #include #include #include #include "../comm/my_recv.h" // 自定义的头文件 #include "../comm/my_recv.c" #define SERVER_IP "127.0.0.1" #define SERV_PORT 6666 // 服务器端的端口 ...

Global site tag (gtag.js) - Google Analytics