Skip to content

Instantly share code, notes, and snippets.

@sakibguy
Forked from preslavmihaylov/macros-in-c-4.c
Created March 8, 2021 15:47
Show Gist options
  • Save sakibguy/4e2bbd1fc4cab615d8e7682e53c55f86 to your computer and use it in GitHub Desktop.
Save sakibguy/4e2bbd1fc4cab615d8e7682e53c55f86 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#define bar() \
int var = 10;\
printf("var in bar: %d\n", var)
void foo()
{
int var = 5;
printf("var in foo: %d\n", var);
bar();
}
int main(int argc, char *argv[])
{
foo();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment