Created
January 22, 2022 02:56
-
-
Save ilmoralito/9cd1ec7d888f1b03bb2fbd3c9ff18010 to your computer and use it in GitHub Desktop.
C sizeof example
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(void) | |
{ | |
printf("char size: %lu bytes\n", sizeof(char)); | |
printf("int size: %lu bytes\n", sizeof(int)); | |
printf("short size: %lu bytes\n", sizeof(short)); | |
printf("long size: %lu bytes\n", sizeof(long)); | |
printf("float size: %lu bytes\n", sizeof(float)); | |
printf("double size: %lu bytes\n", sizeof(double)); | |
printf("long double size: %lu bytes\n", sizeof(long double)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment