Ver Mensaje Individual
  #8 (permalink)  
Antiguo 21/10/2010, 19:17
vnvnation
 
Fecha de Ingreso: marzo-2009
Mensajes: 74
Antigüedad: 15 años, 1 mes
Puntos: 1
Respuesta: Error conversion from `TipoPila**' to non-scalar type `TipoPila' requested

Ya pude ingresar datos no se si a si este bien o mal¿?

Código C++:
Ver original
  1. #include <iostream.h>
  2. #include <conio.h>
  3. #define MAX 3
  4. #define VACIO -1
  5. typedef int TipoTope;
  6. typedef char TipoElem;
  7. typedef struct TipoPila{
  8.          TipoTope Tope ;
  9.           TipoElem Elementos [MAX];
  10.           };
  11.  
  12. int InicializarPila (TipoPila *Stack);
  13. int PilaLlena (TipoPila *Stack);
  14. int Push (TipoPila *Stack, TipoTope valor);
  15. int Pop(TipoPila *Stack, TipoTope valor);
  16.   main ()
  17. {
  18. TipoPila Pila;
  19. TipoElem valor;
  20. int   opcion1=0;
  21. //InicializarPila(&Pila);
  22. //Push (&Pila,valor);
  23.  
  24. while (opcion1!='s')
  25. {
  26. cout << "\n\nSELECCIONE UNA OPCION DE LAS SIGUIENTES:";
  27.  cout <<"\n1 Inicializar Pila";
  28.  cout <<"\n2 Ingresar datos a la Pila";
  29.  cout <<"\n3 Sacar datos de la pila\nOpcion=";
  30.   cin >> opcion1;
  31.  
  32. switch (opcion1){
  33.        case 1:
  34.             InicializarPila(&Pila);
  35.        cout<<"Pila inicializada ...";
  36.        break;
  37.        case 2:
  38.        Push(&Pila,valor);
  39.        break;
  40.        case 3:
  41.        Pop(&Pila,valor);
  42.        break;
  43.  
  44.           }
  45.            
  46. }}
  47.  
  48. int InicializarPila(TipoPila *Stack)
  49. {
  50.      Stack->Tope=VACIO;
  51.      }
  52.  
  53. int Push(TipoPila *Stack, TipoTope valor)
  54.  
  55. {   TipoElem Elementos;
  56.  if(Stack->Tope==MAX)
  57.           cout << "\nPila llena!!!!\n";
  58.  else
  59.  {
  60.      cout<<"Ingrese elementos a la pila:";
  61.      cin >> Elementos;
  62.         Stack->Tope++;
  63.         Stack->Elementos[Stack->Tope] = valor;
  64.  }
  65. }
  66.  
  67.  
  68. int Pop(TipoPila *Stack, TipoTope valor)
  69. {  
  70.  if(Stack->Tope==VACIO)
  71.           cout << "\nPila esta vacia ingrese datos primero:";
  72.  else
  73.  {
  74.         Stack->Tope--;
  75.         Stack->Elementos[Stack->Tope] = valor;
  76.  }
  77. }