Skip to content

Instantly share code, notes, and snippets.

@erikdubbelboer
Created March 8, 2013 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikdubbelboer/5115427 to your computer and use it in GitHub Desktop.
Save erikdubbelboer/5115427 to your computer and use it in GitHub Desktop.
Constructor example
/* ~$ g++ test.c -o test
* ~$ ./test
* 12
*/
#include <stdio.h>
class Test {
public:
int example;
Test(int example) : example(example) {
}
};
int main() {
Test test(12);
printf("%d\n", test.example);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment