Skip to content

Instantly share code, notes, and snippets.

@preslavmihaylov
Created December 10, 2017 17:21
Show Gist options
  • Save preslavmihaylov/9f9c065ceec3c0014d04e165e531f063 to your computer and use it in GitHub Desktop.
Save preslavmihaylov/9f9c065ceec3c0014d04e165e531f063 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#define printErrord(errorCode) printError(errorCode, "No message")
void printError(int errorCode, char *msg)
{
printf("Error code: %d (%s)\n", errorCode, msg);
}
int main(int argc, char *argv[])
{
printError(9, "Bad alloc");
printErrord(8);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment