Advertisement
Guest User

Untitled

a guest
Jun 25th, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.24 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. typedef struct {
  5.   int zot;
  6. } Foo;
  7.  
  8. typedef struct {
  9.   Foo foo;
  10.  
  11. } Bar;
  12.  
  13. int main() {
  14.   Bar *b = (Bar *)malloc(sizeof (Bar));
  15.   Foo *f = &b->foo;
  16.   printf("bar = 0x%x, foo = 0x%x\n", b, f);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement