Created
April 13, 2013 17:18
-
-
Save boukeversteegh/5379264 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 Gate { | |
protected: | |
Out outputs[]; | |
public: | |
virtual void propagate(); | |
}; | |
void Gate::propagate() { | |
int noutputs = sizeof(this->outputs)/sizeof(*(this->outputs)); | |
cout << noutputs << " outputs."; | |
for( int i = 0; i < noutputs; i++ ) { | |
cout << i << endl; | |
} | |
} | |
class And: public Gate { | |
private: | |
In inputs[2]; | |
Out outputs[1]; | |
public: | |
void in(int, bool); | |
bool out(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment