Skip to content

Instantly share code, notes, and snippets.

@ibeauregard
Created April 2, 2021 19:41
Show Gist options
  • Save ibeauregard/747eb7d901de292704097e8d7edcc9ce to your computer and use it in GitHub Desktop.
Save ibeauregard/747eb7d901de292704097e8d7edcc9ce to your computer and use it in GitHub Desktop.
Client cannot access struct int_stack's member
/* main.c */
while (stack->top) {
printf("`%d` was popped from the stack\n", pop_stack(stack));
}
// Output from the compiler:
main.c:11:17: error: incomplete definition of type 'struct int_stack'
while (stack->top) {
~~~~~^
./int_stack.h:6:16: note: forward declaration of 'struct int_stack'
typedef struct int_stack IntStack;
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment