I accidentally wrote foo ((struct Node* ) head);
insteadfoo ((Node* ) head);
And I got a message from the compiler
expected 'struct Node *' but argument is of type 'struct Node *'
#include <stdio.h>
typedef struct NODE
{
char data;
struct NODE *next;
} Node;
void foo (Node *head){}
void bar (void *head)
{
foo ((struct Node* ) head);
}
int main(){
return 0;
}
This is misleading, should it not be in the first case Node *
either struct NODE *
?
what does this message mean? Can anyone clarify this?
I can reproduce it here after deliberately entering an error.
Compiler: gcc (GCC) 4.8.1
source
share