Skip to content

Instantly share code, notes, and snippets.

@hawaijar
Created October 11, 2021 04:22
Show Gist options
  • Save hawaijar/e65bf8e1869d68348be6f3af9374bbde to your computer and use it in GitHub Desktop.
Save hawaijar/e65bf8e1869d68348be6f3af9374bbde to your computer and use it in GitHub Desktop.
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
char charData = 'A';
printf("\nSize of variable charData is %lu byte", sizeof(charData));
int intData = 100;
printf("\nSize of variable intData is %lu bytes", sizeof(intData));
short shortIntData = 20;
printf("\nSize of variable shortIntData is %lu bytes", sizeof(shortIntData));
long int longIntData = 5555555;
printf("\nSize of variable longIntData is %lu bytes", sizeof(longIntData));
float floatData = 4.5;
printf("\nSize of variable floatData is %lu bytes", sizeof(floatData));
double doubleData = 4.5;
printf("\nSize of variable doubleData is %lu bytes", sizeof(doubleData));
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment