Created
February 10, 2017 17:33
-
-
Save DanielUranga/85e6ad886cc4daaf181ea99c94e9822d 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
/* | |
// Esto de aca | |
class Persona { | |
public: | |
int edad; | |
string nombre; | |
Persona(int edad, string nombre){ | |
this->edad = edad; | |
this->nombre = nombre; | |
} | |
~Persona(){ | |
}; | |
void saludar(){ | |
cout << "Hola mi nombre es brian"; | |
} | |
}; | |
*/ | |
// Es exactamente equivalente a esto: | |
class Persona { | |
public: | |
int edad; | |
string nombre; | |
Persona(int edad, string nombre); | |
~Persona(); | |
void saludar(); | |
}; | |
Persona::Persona(int edad, string nombre) { | |
this->edad = edad; | |
this->nombre = nombre; | |
} | |
Persona::~Persona() {} | |
void Persona::saludar() { | |
cout << "Hola mi nombre es brian"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment