Transcription of Common Syntax and Semantic Errors
{{id}} {{{paragraph}}}
5 CHAPTER 2 Common Syntax andSemantic CHAPTER OBJECTIVES To understand the fundamental characteristics of Syntax and semanticerrors To be able to identify specific Common Syntax and Semantic errorsfrequently encountered by beginning programmers To be able to interpret a Syntax warning To be able to apply appropriate techniques to correct these Syntax ERRORSA Syntax erroris a violation of the Syntax , or grammatical rules, of a naturallanguage or a programming language. The following sentence contains anerror of English Syntax :I is going to the concert we write or say this sentence, other English speakers will know that we haveused incorrect grammar, however they will still understand what we mean. Pro-gramming languages are not so forgiving, however. If we write a line of C++ codecontaining a Syntax error, the compiler does notknow what we mean. A syntaxerror is called a fatal compilation error, because the compiler cannot translate aC++ program into executable code if even one Syntax error is 8/21/01 4:16 PM Page 56 Chapter 2 Common Syntax and Semantic Syntax Errors : Summary of Important Points How are they detected?
6 Chapter 2 Common Syntax and Semantic Errors 2.2.1 Syntax Errors: Summary of Important Points • How are they detected?The compiler detects them when you try to compile your program.
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}