Ver Mensaje Individual
  #5 (permalink)  
Antiguo 21/10/2010, 11:59
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

Bueno tengo esto ya mete y saca valores pero no me inicializa la pila me pueden ayudar plis

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 push(int *Stackb, int Stack_i[3]);
  14. void pop(int *Stackc, int Stack_e[3]);
  15.   main ()
  16. {
  17. TipoPila Pila1;
  18. int Stack[3];
  19. int   cima=0,opcion1=0;
  20.  
  21.  
  22. while (opcion1!='s')
  23. {
  24. cout << "\nSELECCIONE UNA OPCION DE LAS SIGUIENTES:";
  25.  cout <<"\n1 Inicializar Pila";
  26.  cout <<"\n2 Ingresar datos a la Pila";
  27.  cout <<"\n3 Sacar datos de la pila\nOpcion=";
  28.   cin >> opcion1;
  29.  
  30. switch (opcion1){
  31.        case 1:
  32.             InicializarPila(&Pila1);
  33.        cout<<"Pila inicializada ...";
  34.        getch ();
  35.        break;
  36.          getch ();
  37.        case 2:
  38.          push(&cima, Stack);
  39.       getch ();
  40.      
  41.       break;
  42.       case 3:
  43. pop(&cima, Stack);
  44.       getch ();
  45.      
  46.       break;
  47.           }
  48.            
  49. }}
  50.  
  51. int InicializarPila(TipoPila *Stack)
  52. {
  53.      Stack->Tope==VACIO;
  54.      }
  55. int push(int *Stack, int Stack_i[3])
  56. {  
  57.  if(*Stack==3)
  58.    cout << "\nPila llena!!!!\n";
  59.  else
  60.  {
  61.   cout << "Ingresa el elemento a la pila\n";
  62.   cin >> Stack_i[*Stack];
  63.   *Stack=*Stack+1;
  64.  }
  65. }
  66. void pop(int *Stack, int Stack_e[3])
  67. {
  68.  
  69.  if (*Stack<=0)
  70.  {
  71.   cout << "No hay elementos en la pila\nIngrese  elementos primero:\n";
  72.  }
  73.  else
  74.  {
  75.   *Stack=*Stack-1;
  76.   cout << "\nElemento expulsado de la fila: ";
  77.   cout << Stack_e[*Stack];
  78.  }
  79.  
  80. }