Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. conversion from `const char[2]' to non-scalar type `Persona' requested
  2.  
  3. #include<iostream>
  4. #include<string>
  5. #include<iomanip>
  6.  
  7. using namespace std;
  8. struct Persona
  9.  
  10. {
  11. string Nombre;
  12. string NumeroTelefono;
  13. Persona *sigDireccion;
  14. };
  15.  
  16. void mostrar(Persona *);
  17.  
  18. int main(){
  19. Persona p1=("a","1");
  20. Persona p2=("b","2");
  21. Persona p3=("c","3");
  22. Persona *primera;
  23. primera=&p1;
  24. p1.sigDireccion=&p2;
  25. p2.sigDireccion=&p3;
  26. p3.sigDireccion=NULL;
  27. mostrar(primera);
  28. return 0;}
  29.  
  30. void mostrar(Persona *contenido)
  31.  
  32. {
  33. while(contenido!=NULL){
  34. cout<<endl<<setiosflags(ios::left)
  35. <<setw(30)<<contenido->Nombre
  36. <<setw(20)<<contenido->NumeroTelefono;
  37. contenido=contenido->sigDireccion;
  38. }
  39. }
  40.  
  41. Persona* p1=("a","1");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement