Intro C: Study Guide
This guide does not include topic
detail
Computer systems
Hardware:
input devices, output devices, CPU, primary storage, secondary storage
Software:
system, application
Types:
PC vs. timeshare vs. client-server
Languages
Natural
(can't do yet)
High-level
(needs compiler to translate)
Symbolic/assembly
(needs assembler to translate)
Machine
Compiling
Translating
high-level code understandable by human who knows the language into machine
code (object code) for a particular architecture of machine
Process
of writing a program
1.
Write/edit the code
2.
Compile/Link
if syntax errors, go back to 1.
3.
Execute
if logical (semantic) errors, go back to 1.
Software
life cycle
System
requirements
Analysis:
first pass of stepwise refinement
Design
algorithm, pseudocode
structure, IPO chart
Implementation
Testing:
whitebox and blackbox
Maintenance
Structure
of a C program
Preprocessor
directives
Global
declarations
User-defined
functions
Structure
of a function: declaration (prototype) and definition
type
fnname(parameter list); // prototype
type
fnname(parameter list)
// definition
{
local definitions/declarations
statements
}
Standard
data types
void,
char, int, float
Extended
data types
unsigned
char
short
unsigned short
unsigned
int
long
unsigned long
double
long
double
bool
Range
of values stored in integer (including char) types
Number
of bytes per type
signed
vs. unsigned
N
bits signed: -2^(n-1) to (2^(n-1) - 1)
N
bits unsigned: 0 to (2^n - 1)
IEEE
floating point standards
Number
of bytes per type
What
bits assigned
Approximately
how much precision per float and double
Type
conversions
Mixed-type
expressions
Implicit
vs. explicit conversions
Assignment
conversion
Arithmetic
promotion
Cast
Promotion
hierarchy
Comments
Purpose
Program
comments, function comments, section comments, line-by-line
Tokens
Identifiers
Keywords
(reserved words)
Operators
Punctuators
Constants:
literals, defined
Start-
and end-of-comment
I/O
printf(control
string, optional list of substitution parameters)
% flag fieldwidth precision conversioncode (italics
indicate optional)
scanf(control
string, list of parameters)
conversion codes only in control string, no spaces, punct, or text
Miscellaneous
code topics
Variables:
how to declare, initialization, assignment
Scope
of variables
Expressions
and statements
Operators
Arithmetic:
+ - * / (integer and float) %
Assignment:
=
Compound
assignment: += -=
*= /= %=
Increment/Decrement:
++ --(prefix and postfix)
Address:
&
(cast)
Precedence
and associativity
Concepts
of programming
Structured
programming: 3 basic control structures (sequence, including fn calls,
selection, repetition)
Programming
objectives (measures of quality)
Readability
Maintainability
Modularity
Portability
Robustness
Miscellaneous
topics
Local vs. global variables
Builtin
vs. user-defined functions
Formal
vs. actual parameters
Ways
to implement constants
Literals
Defined
Miscellaneous
code topics
Scope
of variables
Compound
statements/blocks