-
-
Save jozadaquebatista/5ad6dbb9c44ecb3564ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#if defined(SMALL) | |
#define SIZE 30 | |
#endif | |
#if defined(LARGE) | |
#define SIZE 3000 | |
#endif | |
static char buf[SIZE]; | |
void main(){ | |
printf("%d\n", sizeof(buf)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➤ gcc -DLARGE alloc.c -o LARGE.prog | |
➤ gcc -DSMALL alloc.c -o SMALL.prog | |
➤ ls -l | |
total 48 | |
[...] | |
-rwxr-xr-x 1 brice users 7573 Apr 3 23:25 LARGE.prog | |
-rwxr-xr-x 1 brice users 4901 Apr 3 23:25 SMALL.prog |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment