Skip to content

Instantly share code, notes, and snippets.

@mwbrooks
Created March 29, 2010 23:04
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 mwbrooks/348529 to your computer and use it in GitHub Desktop.
Save mwbrooks/348529 to your computer and use it in GitHub Desktop.
#include <cstdio>
// Class Definition
//
class MyClass
{
public:
void print(int value1, int value2 = 200);
};
// Class Implementation
//
void MyClass::print(int value1, int value2) {
printf("%d %d\n", value1, value2);
}
// Main Entry Point
//
int main (int argc, char * const argv[]) {
MyClass *myClass = new MyClass();
myClass->print(12, 24); // Print: 12, 24
myClass->print(12); // Print: 12, 200
delete myClass;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment