Skip to content

Instantly share code, notes, and snippets.

@doug65536
Created July 28, 2013 22:32
Show Gist options
  • Save doug65536/6100536 to your computer and use it in GitHub Desktop.
Save doug65536/6100536 to your computer and use it in GitHub Desktop.
typedef struct Foo Foo;
Foo *bar; // this is ok
void bartest()
{
bar->a = 2; // this is NOT ok, struct Foo is not defined
}
// Note, no typedef here, just defining struct Foo
struct Foo {
int a, b;
};
var bartest2()
{
bar->a = 2; // this is ok, Foo is now defined
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment