Summary
Historical background. Phases of translation. Preprocessor: include, conditional directives, object and function-like macros. Structure of a C program. Types: static typing, the integer types, floating types. Variable declarations. Arrays, complete and incomplete types. Pointers: pointer types, operations, and 2d-arrays.
C Part 1 Slides: 03_c_part1.pdf
Videos
Code Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#include <stdio.h> #define N 2 #define M 3 int a[N][M]; int main() { // initialize... for (int i=0; i<N; i++) for (int j=0; j<M; j++) a[i][j] = i*M+j; // print... for (int i=0; i<N; i++) { for (int j=0; j<M; j++) printf("%d ", a[i][j]); printf("\n"); } } |