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