C语言中syntax error和run-time error的区别

来源:百度知道 编辑:UC知道 时间:2024/06/24 09:54:02
最好详细一点,把两者的区别写清楚!我是菜鸟,能用英文写更好!

syntax error 语法错误,关键字写错,类型不兼容之类的
run-time error
逻辑错误,内存分配错误之类的

能用英文写更好!:
In computer science a syntax error refers to an error in the syntax of a sequence of characters or tokens that is intended to be written in a particular programming language.

For compiled languages syntax errors occur strictly at compile-time. A program will not compile until all syntax errors are corrected. For interpreted languages however syntax errors cannot be detected until runtime and it is not necessarily simple to differentiate a syntax error from a semantic error.

A syntax error may also occur when an invalid equation is entered into a calculator. This can be caused, for instance, by opening brackets without closing them, or less commonly, entering several decimal points in one number.
----------------
run-time error
In computer science, the qualifier run time, run-time, runtime, or execution time refers to the period while a computer program