+ 1
What is difference between runtime error and compile-time error?
Thanks for answers
3 ответов
+ 1
Compile-time is the instance where the code you entered is converted to executable while Run-time is the instance where the executable is running. The terms "runtime" and "compile time" are often used by programmers to refer to different types of errors too. Compile-time checking occurs during the compile time while Run-time type checking happens during run time of programs.
Compile time:
string my_value = Console.ReadLine();
int i = my_value;
A string value can't be assigned a variable of type int, so the compiler knows for sure at compile time that this code has a problem
Run time:
string my_value = Console.ReadLine();
int i = int.Parse(my_value);
Here the outcome depends on what string was returned by ReadLine(). Some values can be parsed to an int, others can't. This can only be determined at run time
http://net-informations.com/JUMP_LINK__&&__python__&&__JUMP_LINK/iq/checking.htm
+ 6
Compile time error means syntax error .Runtime error means when it runs it gives error:
https://www.tutorialspoint.com/difference-between-compile-time-errors-and-runtime-errors-in-c-program#:~:text=Compile%2Dtime%20errors%20are%20generally,execution%20of%20code%20at%20runtime.&text=Compile%2Dtime%20errors%20get%20detected,the%20time%20of%20code%20development.
https://www.geeksforgeeks.org/difference-between-compile-time-errors-and-runtime-errors/
https://stackoverflow.com/questions/9471837/what-is-the-difference-between-run-time-error-and-compiler-error