I'm trying to make a dynamic stack, and for some reason something is wrong with the init
function. You are giving the following error:
warning: conflicting types for 'init'
#include <stdio.h>
#include <stdlib.h>
typedef struct TipoCelular
{
int elemento;
struct TipoCelular *prox;
}elementoPilha;
typedef struct TipoTopo
{
elementoPilha *Topo;
}Pilha;
int main()
{
Pilha *p;
init(p);
if(empty(p))
printf("Pilha vazia\n");
return 0;
}
void init(Pilha *p)
{
p->Topo = NULL;
}
int empty(Pilha *p)
{
if(p->Topo == NULL)
return 1;
return 0;
}