6.3w+
社区成员
#ifndef MAIN_H_
#define MAIN_H_
其它内容
#endif
#ifdef _DEBUG
printf("this debug info\n");
#endif
#include <stdio.h>
int main()
{
#ifdef _DEBUG
printf("hello world\n");
#else
printf("no debug");
#endif
return 0;
}
#include <stdio.h>
#define PRINT_STR "你好 DD"
main(){
printf(PRINT_STR);
return 0;
}
#include <stdio.h>
#ifdef _DEBUG
#define A(x) a(x)
#else
#define A(x) b(x)
#endif
int a(int x)
{
return x+1;
}
int b(int x){
return x+100;
}
int main(){
printf ("A(10) value is %d",A(10));
return 0;
}
#define PRINT(...) printf(__VA_ARGS__)
#include <stdio.h>
int main(){
PRINT("%d %s %s",1,"吃饭了吗 smile MM:)","\n");
return 0;
}
#define s5(a) supper_ ## a
#include <stdio.h>
void supper_printf(const char* p )
{
printf("this is supper printf:\n%s\n",a);
}
int main()
{
s5(printf)("hello owrld");
return 0;
}
//用法
#include <stdio.h>
#define s(p) #p
int main(){
printf(s(p)"\n");
return 0;
}