Debugging in C Guidelines

Finding Bugs

To find bugs in your code, follow the steps below.

Frequently Seen Mistakes
  1. You get the correct results in grace, but not in the submit server - This may happen because:
    • You have uninitialized variables. Grace seems to set uninitialized variables to 0.
    • Your strings are missing a null character ('\0').
    • You are not declaring an array that is large enough.
    • You are passing to a function a pointer to a character rather than a pointer to an array of characters.
  2. Your code might be generating a core dump in the submit server if, for a test, the submit server displays a message along the lines "expected ... but output ended".
Web Accessibility