Warning on battery pointers

0

I'm trying to do a simple stack implementation, however the message appears:

  

warning: initialization from incompatible pointer type   -Wincompatible-pointer-types

This warning appears on both line 20 and line 29. These pointers are of the same type (in the *) and the implementation works correctly. Can anyone help me?

    
asked by anonymous 15.09.2017 / 19:01

1 answer

0

You defined your Node structure to be:

typedef struct _no {
   int item;
   struct no *prox;
} no;

The right thing would be:

typedef struct no {
   int item;
   struct no *prox;
} no;

Without the underscore

    
15.09.2017 / 19:53