Use macro to build string : Macro String « Macro Preprocessor « C / ANSI-C






Use macro to build string

#include <stdio.h>

#define MKSTRING(str) # str

int main(void)
{
  int value;

  value = 10;

  printf("%s is %d", MKSTRING(value), value);

  return 0;
}


           
       








Related examples in the same category

1.Output string using Macro
2.Join string