csc201 Notes 20100825

Posted in csc201 by bnmng on 2010 08/25

Homework Read Chapter 4 to page 160

The main has to be a function so it can be called by the operating system. This allows the operating system to call the program and pass parameters to it.

Rules for identifiers:
Types of identifiers.
User defined,
reserved words

Identifiers are the names you give to functions and variables, etc..
Have to start with a letter or underscore, remaining characters can be numbers, letters, or underscores.

Identifiers cannot be reserved words

Be careful not to use an identifier that is already the name of a library function, or you will loose use of the library function.

Escape sequences, although represented as two characters, are actually a single characters.

C Strings are an array of characters with the null terminator at the end. They’re not officially strings until they’re assigned to a variable. **Need to check this**

Assignments. Syntax, need a variable on the left hand side. On the right, a constant, another variable, or an expression.

Int m=15; is not considered an executable code. It’s a declaration.

The string operator ‘+’ is called the concatonator.

Concatinating c strings. One has to be from the string library. You cannot concatinagte “Whoever” + “Whatever” because those are cstrings and are not in the string library. But if you assign “Whoever” to a variable, like w, than you can concatinate y=w+”whatever”.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: