Skip to content

Instantly share code, notes, and snippets.

@kalimalrazif
Last active January 30, 2017 02:19
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 kalimalrazif/9e400864d1dc2bbf2e12fe817251bd18 to your computer and use it in GitHub Desktop.
Save kalimalrazif/9e400864d1dc2bbf2e12fe817251bd18 to your computer and use it in GitHub Desktop.
Implementacion de la clase animal
#include "animal.h"
Animal::Animal() {
this->setPatas(0);
}
void Animal::setPatas(int patas) {
// Los animales pueden tener 0 patas pero no un
// numero negativo de estas.
if (patas < 0) { patas = 0; }
this->patas = patas;
return;
}
int Animal::getPatas() {
return this->patas;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment