UNIX VIII: Errors
- Programming errors are when something goes wrong with your program.
They are classfied by who catches them: if the compiler notices something
wrong, it is called a compile time error and if the operating
system catches (or crashes) the error while running your program it is
called a run time error.
- Compile time errors come about mostly when your program fails to
conform to the syntax of the C language. These are the syntax
errors. For example, forgetting a period at the end of sentence
is a syntax error in English.
- The compiler will also generate an error if you try to use something
before you define it, or if you use more memory than your computer has,
and things like that. The compiler will not produce code if it finds
an error.
- Run time errors include things like dividing by zero, running out
of dynamically allocated memory, or even (technically) the user control-Cing
the program.
- Later on in the course when we cover exceptions and signals we will
show you how to tell the operating system to keep on running your program
even when it commits run time errors.
Next Slide