[prev] 179 [next]

Common Mistakes

Warning! Warning! Warning! Warning!

  • Never #include an ADT implementation file

    #include "Stack.c"     // correct is: #include "Stack.h"
    

  • Do not try to access struct details in a client

    #include "Stack.h"
    ...
    stack S = newStack();
    ...
    if (S->height == 0) {   // correct is: StackIsEmpty(S)  
    ...