CS 150 Introduction to C++ Programming - Spring 1998 

[ Home | Lecture Notes| WebTutor | WebTutor Site Map]


C++ Syntax and Semantics

Valid Identifiers


Syntax is the grammar of the language, that is the rules for constructing valid statements in that language.
If you break the rules the compiler will complain.

Semantics is what the statements mean, like calculating something or printing out a message.
Computers can't read your mind, so they don't help much if the meaning of your program is not what you wanted.

Let's start with some syntax.

1. Mark the following as either valid or invalid (see pages 49-51 in chapter 2 for details):

  Valid Invalid
item#1
data
y
3Set
PAY_DAY
bin-2
num5
Sq Ft
Choose one when done
   

Copyright chris wild 1998.
For problems or questions regarding this web contact [Dr. Wild (e-mail:wild@cs.odu.edu].
Last updated: March 05, 1998.