Skip to content

Instantly share code, notes, and snippets.

@sakibguy
Forked from preslavmihaylov/macros-in-c-6.c
Created March 8, 2021 15:47
Show Gist options
  • Save sakibguy/4bb22de1f96b323390b3bc011437771c to your computer and use it in GitHub Desktop.
Save sakibguy/4bb22de1f96b323390b3bc011437771c 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