Syntax error

From Free net encyclopedia

(Difference between revisions)

Current revision

A syntax error refers to a mistake in a statement's syntax. This term is used mostly in association with programming languages or command line interfaces. In compiled programming languages, a syntax error is a fatal error that the programmer must correct before being able to fully compile the program. Some IDEs are able to display syntax errors in real-time.

Syntax errors may also occur when an invalid equation is entered into a calculator. This is most often caused by opening brackets without closing them, or less commonly, using several decimal points in one number.

Example of a syntax error in [[C++]]

#include <iostream>

int main()
{
     std::cout << "Hello world!\n";

     return 0
}

In the above example, an expected semi-colon is missing after the return statement.

See also

Template:Compu-soft-stubsv:Syntax error