+ 1

What is difference between runtime error and compile-time error?

Thanks for answers

19th Sep 2020, 1:46 PM
Selin Doga Orhan
Selin Doga Orhan - avatar
3 odpowiedzi
+ 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
17th Feb 2021, 4:45 AM
warnerjonn
19th Sep 2020, 1:48 PM
The future is now thanks to science
The future is now thanks to science - avatar