Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  4.  
  5. using namespace std;
  6.  
  7. class Persona
  8. {
  9. public:
  10. string m_nombre;
  11. string m_apellido;
  12.  
  13. string dameNombreFull()
  14. {
  15. string nombreFull;
  16. nombreFull.append(m_nombre).append(" ").append(m_apellido);
  17. return nombreFull;
  18. }
  19.  
  20. void saludaA(Persona)
  21. {
  22. }
  23. };
  24.  
  25. void funcionSaluda(string nombre)
  26. {
  27. cout <<"Hola "<<nombre<<endl;
  28. }
  29.  
  30. int main(int argc, char** argv) {
  31.  
  32.  
  33. string nombre;
  34. cout<<"Ingresa tu nombre y luego presiona ENTER :";
  35. cin>>nombre;
  36.  
  37. string apellido;
  38. cout<<"Ingresa tu apellido y luego presiona ENTER :";
  39. cin>>apellido;
  40.  
  41. Persona p1;
  42. p1.m_nombre = nombre;
  43. p1.m_apellido = apellido;
  44. p1.dameNombreFull();
  45.  
  46. funcionSaluda(p1.dameNombreFull());
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement