lecture03 - Last time Chapter 2, Basic concepts...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Low-Level Programming Concepts CMSC 212 ecture 3 1 CMSC 212 Lecture 3 September 8, 2009 Last time Chapter 2, Basic concepts printf() and scanf() for input and output – function calls and arguments Chapter 3, Data – integer and real (floating-point) types – variable declaration and initialization numerated types 2 CMSC 212 – enumerated types – C arrays and strings – pointers: * preceding a variable name in a declaration makes it a pointer the operator returns the memory address of a variable the * operator dereferences a pointer Reading Read Chapter 8 in Reek (Pointers on C) next 3 CMSC 212 Chapter 3, Data, con't. 4 CMSC 212
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The const keyword const indicates a variable or parameter can't be changed or const int *p; (or int const *p; ) – a pointer to an integer that can't be changed const int w= 1; int x= 2; p= &x; /* valid */ p= ; * nvalid / int const w= 1; 5 CMSC 212 int *const q= ; – a constant pointer to an integer const int *const r= ; – a constant pointer to a constant integer *p= 3; /* invalid */ int y= 4, z= 5; int *const q= &y; *q= 6; /* valid */ q= &z; /* invalid */ const int *const r= &z; Some properties of variables and identifiers Scope Linkage Storage class (or extent ) The four specifiers auto , extern , static , and register can be used to affect identifiers' linkage 6 CMSC 212 and extent Types of scope The two main types of scope in C are block scope and file scope Declaring an identifier with the same name as one in an
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/23/2009 for the course CMSC 212 taught by Professor Staff during the Spring '08 term at Maryland.

Page1 / 5

lecture03 - Last time Chapter 2, Basic concepts...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online