Created
September 12, 2021 21:56
-
-
Save mkropat/c9de282788c8dc23ed0c0d4fb8c9f698 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
// gcc -I$JAVA_HOME/include -I$JAVA_HOME/include/linux jsizes.c -o jsizes && ./jsizes | |
#include <stdio.h> | |
#include <jni.h> | |
int main() { | |
printf("jboolean %li\n", sizeof (jboolean)); | |
printf("jbyte %li\n", sizeof (jbyte)); | |
printf("jchar %li\n", sizeof (jchar)); | |
printf("jshort %li\n", sizeof (jshort)); | |
printf("jint %li\n", sizeof (jint)); | |
printf("jlong %li\n", sizeof (jlong)); | |
printf("jfloat %li\n", sizeof (jfloat)); | |
printf("jdouble %li\n", sizeof (jdouble)); | |
printf("jsize %li\n", sizeof (jsize)); | |
printf("\n"); | |
printf("unsigned char %li\n", sizeof(unsigned char)); | |
printf("unsigned short %li\n", sizeof(unsigned short)); | |
printf("unsigned int %li\n", sizeof(unsigned int)); | |
printf("unsigned long %li\n", sizeof(unsigned long)); | |
printf("unsigned long long %li\n", sizeof(unsigned long long)); | |
return 0; | |
} |
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() { | |
printf("int %li\n", sizeof (int)); | |
printf("long %li\n", sizeof (long)); | |
printf("size_t %li\n", sizeof (size_t)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment