Last active
May 15, 2019 23:06
-
-
Save echiesse/c349b62478e3036c7754a9ebf422997b to your computer and use it in GitHub Desktop.
C sizeof on vars, arrays and malloc
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> | |
int main() | |
{ | |
int a[5]; | |
int b; | |
int* c = malloc(10 * sizeof(int)); | |
printf("%i\n", sizeof(a)); | |
printf("%i\n", sizeof(b)); | |
printf("%i\n", sizeof(c)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment