aboutsummaryrefslogtreecommitdiff
path: root/gfsm/gfsm/src/libgfsm/tests/ptest.c
blob: 44911cdd62bbaaf2aea2f98ccdd7689ae14d4523 (plain)
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
#include <glib.h>
#include <stdio.h>

typedef struct _xstruc {
  int x;
  int y;
} xstruc;

int main (void) {
  xstruc xs = {42,24};
  xstruc *xsp = &xs;
  void   *vp  = xsp;
  char *s = NULL;
  char *s2;

  printf ("&xs    =%p  ; xsp    =%p ; vp    =%p\n", &xs, xsp, vp);
  printf ("&xs.x  =%p  ; &xs.y  =%p\n", &xs.x, &xs.y);
  printf ("&xsp->x=%p  ; &xsp->y=%p\n", &xsp->x, &xsp->y);
  printf ("(vp)->x=%p  ; (vp)->y=%p\n", &((xstruc*)vp)->x, &((xstruc*)vp)->y);

  printf("\n");
  printf("s=%p ; s2=%p\n", s, g_strdup(s));

  return 0;
}