Skip to content

Instantly share code, notes, and snippets.

@K-atc
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save K-atc/534184063aa02bace74b to your computer and use it in GitHub Desktop.

Select an option

Save K-atc/534184063aa02bace74b to your computer and use it in GitHub Desktop.
#include <stdio.h>
#define SHARP_OP_TEST(expr) (printf("#expr = %s, expr = %d\n", #expr, (expr)) )
#define var(i) printf("var" #i " = %d\n" , var ## i)
#define CONBINE(a, b) (printf("%s\n", a##b))
int main(void){
const char test[] = "This is test";
int var1 = 10;
SHARP_OP_TEST(1+2);
var(1);
CONBINE(te,st);
return 0;
}
// outputs
// #expr = 1+2, expr = 3
// var1 = 10
// This is test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment