Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/12/2012, 07:48
fernandez6
 
Fecha de Ingreso: diciembre-2012
Mensajes: 11
Antigüedad: 11 años, 5 meses
Puntos: 0
Probelma con el set

Tengo un problema con el siguiente programa. Al compilarlo me sale el siguiente error:

"Antonio was not declared in this scope"

Os copio el .h primero y luego el main

Código c++:
Ver original
  1. class Persona {
  2.  
  3. public:
  4.  
  5. void setedad(int edad)
  6.  
  7. {
  8. m_edad = edad;
  9. }
  10.  
  11. void setnombre (const string& nombre)
  12.  
  13. {
  14. m_nombre = nombre;
  15. }
  16.  
  17. int getedad ()
  18.  
  19.  
  20. {
  21.     return m_edad;
  22. }
  23.  
  24. const string getnombre()
  25.  
  26. {
  27.     return m_nombre;
  28. }
  29.  
  30. void display()
  31. {
  32.  
  33. cout << getnombre() << " , " << getedad() << endl;
  34.  
  35. }
  36. private:
  37.  
  38. int m_edad;
  39. string m_nombre;
  40.  
  41. };

Este es el main

Código c++:
Ver original
  1. #include <point.h>
  2.  
  3. int main() {
  4.  
  5. Persona nueva;
  6.  
  7. nueva.setedad(56);
  8. nueva.setnombre(Antonio);
  9.  
  10. nueva.display();
  11.  
  12. }

Un saludo y gracias