fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Gatito {
  5. public:
  6. string nombre;
  7. string color;
  8. Gatito(string x, string h) : nombre(x), color(h) {} // Constructor
  9. void Maullar() {
  10. cout << "¡Miau! Soy " << nombre << " de color " << color << endl;
  11. }
  12. };
  13.  
  14. int main() {
  15. Gatito miGatito("Negrita", "Negro");
  16. miGatito.Maullar();
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
¡Miau! Soy Negrita de color Negro