Created
March 29, 2010 23:04
-
-
Save mwbrooks/348529 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
#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