Ver Mensaje Individual
  #12 (permalink)  
Antiguo 21/10/2010, 20:01
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

Entonces seria algo a si o aun esta mal ¿? Regañame si es necesari siii

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);
  16.   main ()
  17. {
  18.        system ("color f9");
  19. TipoPila Pila;
  20. TipoElem valor;
  21. int   opcion1=0;
  22. //InicializarPila(&Pila);
  23. //Push (&Pila,valor);
  24.  
  25. while (opcion1!='s')
  26. {
  27. cout << "\n\nSELECCIONE UNA OPCION DE LAS SIGUIENTES:";
  28.  cout <<"\n1 Inicializar Pila";
  29.  cout <<"\n2 Ingresar datos a la Pila";
  30.  cout <<"\n3 Sacar datos de la pila\nOpcion=";
  31.   cin >> opcion1;
  32.  
  33. switch (opcion1){
  34.        case 1:
  35.             InicializarPila(&Pila);
  36.        cout<<"Pila inicializada ...\n";
  37.        system ("pause");
  38.        break;
  39.        case 2:
  40.        Push(&Pila,valor);
  41.        break;
  42.        case 3:
  43.        Pop(&Pila);
  44.        system ("pause");
  45.        break;
  46.  
  47.           }
  48.    system ("cls");      
  49. }}
  50.  
  51. int InicializarPila(TipoPila *Stack)
  52. {
  53.      Stack->Tope=VACIO;
  54.      }
  55.  
  56. int Push(TipoPila *Stack, TipoTope valor)
  57.  
  58. {   TipoElem Elementos;
  59.  if(Stack->Tope==MAX){
  60.           cout << "\nPila llena!!!!\n";
  61.           system ("pause");}
  62.  else
  63.  {
  64.      cout<<"Ingrese elementos a la pila:";
  65.      cin >> Elementos;
  66.         Stack->Tope++;
  67.  }
  68. }
  69.  
  70.  
  71. int Pop(TipoPila *Stack)
  72. {  
  73.  if(Stack->Tope==VACIO)
  74.           cout << "\nPila esta vacia ingrese datos primero:\n";
  75.  else
  76.  {
  77.         Stack->Tope--;
  78.         return Stack->Elementos[Stack->Tope+1] ;
  79.        }
  80. }