C/C++ 언어 offsetof 매크로에 대한 예제 프로그램


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* offsetof 매크로에 대한 예제 프로그램 */
#include <stdio.h>
#include <stddef.h>   
 
void main(void) {
  struct offset {
    int a;
    char b;
    float c;
  } oso;
 
  printf("a : %d\n", offsetof(struct offset, a));
  printf("b : %d\n", offsetof(struct offset, b));
  printf("c : %d\n", offsetof(struct offset, c));
}
cs


C/C++ 언어 offsetof 매크로에 대한 예제 프로그램



+ Recent posts