Differences Between Compile-Time and Runtime In C Language
Categories: C language
1. The compile-time errors are the errors which are produced at the compile-time, and they are detected by the compiler.
2. In this case, the compiler prevents the code from execution if it detects an error in the program.
3. It contains the syntax and semantic errors such as missing semicolon at the end of the statement.
4. Compile-time errors are generally referred to the error corresponding to syntax or semantics.
5. Compile-time errors get detected by compiler at the time of code development.
6. Compile-time errors as already mentioned can get fixed at the time of code development.
1. The runtime errors are the errors which are not generated by the compiler and produce an unpredictable result at the execution time.
2. In this case, the compiler does not detect the error, so it cannot prevent the code from the execution.
3. It contains the errors such as division by zero, determining the square root of a negative number.
4. Runtime errors on the other hand refer to the error encountered during the execution of code at runtime.
5. Runtime time errors are not get detected by compiler and hence identified at the time of code execution.
6. Runtime time errors are getting to fixing state after once code get executed and errors get identified.