Skip to content

Instantly share code, notes, and snippets.

@trikitrok
Last active June 30, 2024 14:19
Show Gist options
  • Save trikitrok/ec0fc20d1b52f4602d29 to your computer and use it in GitHub Desktop.
Save trikitrok/ec0fc20d1b52f4602d29 to your computer and use it in GitHub Desktop.
Duck class
#ifndef DUCK_H_
#define DUCK_H_
class QuackBehavior;
class Duck {
public:
Duck(QuackBehavior * quackBehavior);
virtual ~Duck();
void quack();
void changeHowToQuack(QuackBehavior * quackBehavior);
protected:
QuackBehavior * howToQuack;
};
#endif /* DUCK_H_ */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment