Columbia COMS 1003 - Constants, Typedef, Storage Classes

Unformatted text preview:

COMS 1003: Introduction to Computer Programming in CConstants, Typedef, Storage ClassesOctober 6th 2005Announcements●Use the blog●HW1 due Thursday before class●HW2 is available●HW3 and 4 released Thursday●mid-semster reviews (Courseworks)Outline●Review (Functions, Recursion)●Type Modifiers (Declarators)–constant data–type renaming (typedef)–static, register, automaticConstant Variables●An oxymoron●How can something be a variable if the value never changes?●Need to have values that the program can't modify–protection against coding mistakes–well-known names for reuseUse the keyword const●part of the type information when declaring a variable–const int STRESS_LIMIT = 4000;●note that no unit information is provided (just like normal variables)●subsequent attempt to change the value of STRESS_LIMIT will be caught by the compilerType Aliasing●The typdef keyword can be used to equate primitive types and groupings of primitive types with a more useful name//what do I do?typedef string char[80];typedef int number_t;typedef long time_t;Storage Classes, Scope, and Visibility●register●automatic●static●local vs. global scope–variables–functions (static vs.


View Full Document

Columbia COMS 1003 - Constants, Typedef, Storage Classes

Download Constants, Typedef, Storage Classes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Constants, Typedef, Storage Classes 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 Constants, Typedef, Storage Classes 2 2 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?