UMD CMSC 212 - Lecture Slides (9 pages)

Previewing pages 1, 2, 3 of 9 page document View the full content.
View Full Document

Lecture Slides



Previewing pages 1, 2, 3 of actual document.

View the full content.
View Full Document
View Full Document

Lecture Slides

49 views

Lecture Notes


Pages:
9
School:
University of Maryland, College Park
Course:
Cmsc 212 - Introduction To Low-level Programming Concepts
Introduction To Low-level Programming Concepts Documents

Unformatted text preview:

Announcements Last Day for Schedule Adjustments 2 6 07 next Tuesday Program 1 due 2 13 07 Quiz 1 Monday February 5 in Discussion Section UNIX Email please send email to course staff from UMD accounts email from hotmail yahoo aol etc will often be auto deleted Reading Chapter 3 4 Chapter 7 8 Tuesday 1 CMSC 212 S07 lect 3 Data Types in C Integer Family char typically 8 bits short typically 16 bits int typically 32 or 64 bits long typically 32 or 64 bits long long typically 64 bits All are signed by default but can be made unsigned unsigned int typically 0 to 4 294 967 295 Literals Decimal 255 Hex 0x255 signed 255 Character a n Don t be stingy with size when in doubt use a larger size Floating Point float double long double Literals 3 14159 1E10 25 6 023e23 CMSC 212 S07 lect 3 2 1 1 Data Types in C cont String Literals a long dull string n Enumerated Types Declaring an enumerated type enum operatorType plusOperator minusOperator Declaring a variable of an enumerated type enum operatorType currentOperator Using an enumerated type in an expression currentOperator plusOperator Can control values of enumerated type enum operatorType plusOperator 3 minusOperator 8 3 CMSC 212 S07 lect 3 Variable Declarations type variable1 variable2 int a b c Variables names may not be reserved words Must start with A Z a z May contain numbers or aValid Variable Name aValid Variable Name 2 May initialize variables as part of declaration int a 4 Implicit Declarations Book section 3 2 4 Skip section book and don t ever use CMSC 212 S07 lect 3 4 2 2 Simple Arrays Array dimensions must be known at compile time Array Declaration int a 10 array of 10 elements Accessing array elements Arrays start from 0 and go to n 1 elements Compiler will let programmer access invalid elements Can lead to many problems that are hard to find Examples of array references A 0 A i A i 3 5 CMSC 212 S07 lect 3 Typedef Sometimes you want to name your own type Makes program easier to read Makes it easier to change types



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Lecture Slides and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Slides and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?