Skip to content

Instantly share code, notes, and snippets.

@drguildo
Last active November 29, 2021 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drguildo/7c95ea068ab655d0ec2caca753e4bf7a to your computer and use it in GitHub Desktop.
Save drguildo/7c95ea068ab655d0ec2caca753e4bf7a to your computer and use it in GitHub Desktop.
#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