Created
August 19, 2014 16:55
-
-
Save rwcarlsen/199daf5ab59e98adc321 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
class Foo { | |
public: | |
Foo() : myfoo(NULL) {}; | |
void eat_cheese(std::string type) { | |
//... | |
} | |
static Foo* TheFoo(int index) { | |
if (myfoo == NULL) { | |
myfoo = new Foo(); | |
} | |
return myfoo; | |
}; | |
private: | |
static Foo* myfoo; | |
int age; | |
double height; | |
}; | |
void make_elliott_happy(int foo, int bar, double baz) { | |
Foo* foo = TheFoo(); | |
foo->age = foo; | |
// ... | |
} | |
void eat_cheese(Foo* foo, std::string name) { | |
foo->eat_cheese(name); | |
} | |
int main(labla) { | |
// ... | |
unsigned long int foo = Foo::TheFoo(); | |
make_elliott_happy(foo, blablabla, bar); | |
eat_cheese(foo, blablabla); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment