Created
July 28, 2013 22:32
-
-
Save doug65536/6100536 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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