What is Syntax Error?

What is Syntax Error

Syntax Error

Every programming languages have their own set of rules for writing programs. These rules are called “Syntax”. While writing computer programs, the violation of syntax in program is called syntax error. In computer science, a syntax error is 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.

Reasons of Syntax Error

  • Syntax error will occur if we miss semicolon at the end of each statement in C++.
  • Due to violation of variable naming rules
  • Incorrect use of keywords
  • Missing pair of brackets
  • Invalid function call
  • Missing main() function

Post a Comment

Previous Post Next Post