Skip to content

Instantly share code, notes, and snippets.

@khayrov
Created June 1, 2012 11:05
Show Gist options
  • Save khayrov/2851242 to your computer and use it in GitHub Desktop.
Save khayrov/2851242 to your computer and use it in GitHub Desktop.
#include <stdio.h>
struct B;
struct A
{
struct B *ptr;
};
struct B
{
struct A *ptr;
};
extern struct B b;
struct A a = { &b };
struct B b = { &a };
int main(void)
{
printf("a = %p, b = %p\n", &a, &b);
printf("a->ptr = %p, b->ptr = %p\n", a.ptr, b.ptr);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment