Last active
November 29, 2021 17:02
-
-
Save drguildo/7c95ea068ab655d0ec2caca753e4bf7a to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
#include <stdint.h> | |
typedef struct { | |
char a; | |
long b; | |
char c; | |
} Struct; | |
int main(int argc, char const *argv[]) | |
{ | |
int8_t* p8 = 0x0; | |
p8++; | |
printf("int8_t++ = %d\n", p8); | |
int16_t* p16 = 0x0; | |
p16++; | |
printf("int16_t++ = %d\n", p16); | |
int32_t* p32 = 0x0; | |
p32++; | |
printf("int32_t++ = %d\n", p32); | |
printf("sizeof(short) = %d\n", sizeof(short)); | |
printf("sizeof(int) = %d\n", sizeof(int)); | |
printf("sizeof(long) = %d\n", sizeof(long)); | |
printf("sizeof(long long) = %d\n", sizeof(long long)); | |
printf("sizeof(Struct) = %d\n", sizeof(Struct)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment