Presentation is loading. Please wait.

Presentation is loading. Please wait.

Review C Language Features –control flow –C operators –program structure –data types –I/O and files Problem Solving Abilities.

Similar presentations


Presentation on theme: "Review C Language Features –control flow –C operators –program structure –data types –I/O and files Problem Solving Abilities."— Presentation transcript:

1 Review C Language Features –control flow –C operators –program structure –data types –I/O and files Problem Solving Abilities

2 Control flow Looping with while, for, do-while conditional execution with if, if-else, switch jumps with break, continue, goto

3 Control flow for(j = 0, j < 10; ++j) {... } if ( x < 0 ) {... } else {... }

4 C Operators Meaning of the various operators and their precedence and association. What are ++, --, &&, ||, !, ~, &, ^, |, =, ==, !=,, >>,,., ? :, sizeof, etc

5 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.

6 Program Structure #include int g = 0; char f(int x); main() { char c; c = f(5);... } char f(int x) {... }

7 Data Types Simple data types - int, char, float, double Array, pointer, equivalence between array syntax and pointer syntax User defined types - structure, typedef

8 Data Types main() { int x, y, *p; char s[100]; struct str { float u; float v; int *pt; } a, b, c;... }

9 Others Macros, #define, #if, etc Open and close files Dynamic memory allocation, malloc(), calloc() Internal representations of integers Type casts

10 Problem Solving The ability of solving a problem by computation through a computer program (efficiently)

11 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%

12 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/


Download ppt "Review C Language Features –control flow –C operators –program structure –data types –I/O and files Problem Solving Abilities."

Similar presentations


Ads by Google