Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- using namespace std;
- class Persona
- {
- public:
- string m_nombre;
- string m_apellido;
- string dameNombreFull()
- {
- string nombreFull;
- nombreFull.append(m_nombre).append(" ").append(m_apellido);
- return nombreFull;
- }
- void saludaA(Persona)
- {
- }
- };
- void funcionSaluda(string nombre)
- {
- cout <<"Hola "<<nombre<<endl;
- }
- int main(int argc, char** argv) {
- string nombre;
- cout<<"Ingresa tu nombre y luego presiona ENTER :";
- cin>>nombre;
- string apellido;
- cout<<"Ingresa tu apellido y luego presiona ENTER :";
- cin>>apellido;
- Persona p1;
- p1.m_nombre = nombre;
- p1.m_apellido = apellido;
- p1.dameNombreFull();
- funcionSaluda(p1.dameNombreFull());
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement