Upload
abigayle-chambers
View
218
Download
3
Embed Size (px)
Citation preview
Review
• C Language Features
– control flow
– C operators
– program structure
– data types
– I/O and files
• Problem Solving Abilities
Control flow
• Looping with while, for,
do-while
• conditional execution with
if, if-else, switch
• jumps with break,
continue, goto
Control flow
for(j = 0, j < 10; ++j) { . . . }
if ( x < 0 ) { . . . } else { . . .}
C Operators
• Meaning of the various
operators and their
precedence and association.
• What are ++, --, &&,
||, !, ~, &, ^, |, =,
==, !=, <, >, >>, <<,
+=, &=, *, ->, ., ? :,
sizeof, etc
Program Structure
• main() and function, function
prototype declaration,
function definition, argument
passing, call by value vs call
by reference.
• Auto, extern, static storage
classes
• Use of standard library
functions, especially I/O
functions.
Program Structure
#include <stdio.h>
int g = 0;
char f(int x);
main()
{
char c;
c = f(5);
. . .
}
char f(int x)
{
. . .
}
Data Types
• Simple data types - int,
char, float, double
• Array, pointer, equivalence
between array syntax and
pointer syntax
• User defined types -
structure, typedef
Data Types
main()
{
int x, y, *p;
char s[100];
struct str {
float u;
float v;
int *pt;
} a, b, c;
. . .
}
Others
• Macros, #define, #if, etc
• Open and close files
• Dynamic memory allocation, malloc(), calloc()
• Internal representations of integers
• Type casts
Problem Solving
• The ability of solving a
problem by computation
through a computer program
(efficiently)
Final Exam
• Last for 2 hours
• 5 to 6 problems with varied weights
• Problems similar to tutorials and labs
• Requirement of memorization is minimal
• Overall weights, midterm and quizzes 20%, labs 20%, final 60%
Consultation During Review Period
• Feel free to ask A/Prof Wang Jian-Sheng or Mdm Alice Heng questions on C.
• A/Prof Wang's office: S17, Level 7, room 07-21. Tel 874 6880.
• Consult our CZ1102 web pages (transparencies) if you have never been there: http://www.cz3.nus.edu.sg/