Skip to content

Instantly share code, notes, and snippets.

@sarnesjo
Created May 4, 2011 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sarnesjo/955622 to your computer and use it in GitHub Desktop.
Save sarnesjo/955622 to your computer and use it in GitHub Desktop.
Useful macro for dumping a variable to stderr
#define PRINT_VAR(NAME, FORMAT) fprintf(stderr, "%20s: "FORMAT"\n", #NAME, NAME)
#define PRINT_PTR(NAME) PRINT_VAR(NAME, "%p")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment