블로그 이미지
송시혁

calendar

1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30

Notice

Tag

Recent Post

Recent Comment

Recent Trackback

Archive

#include <stdio.h>
#pragma pack(1)// 변수크기를 최적화.
struct SMART
{
  int a;
  char b;
  int c;
  short d;
  char e;
  int f;
  char g;
  short h;
  char i;
};


#include <stdio.h>
#pragma pack(4) // 1,2,4,8,16 사용가능.4= 8바이트가 커진다.
struct SMART1
{
  int a;
  char b;
  int c;
  short d;
  char e;
  int f;
  char g;
  short h;
  char i;
};
      

int main()
{
  
  
  
  
  printf("구조체 크기: %d\n"sizeof(struct SMART));
  printf("구조체 크기: %d\n"sizeof(struct SMART1));

  return 0;
}




posted by 송시혁