Lecture 1: The algorithm and the programming languages. |
1. The algorithm and its different representations: flowchart, pseudocode, natural language.
2. Algorithm implementation by means of a programming language. Programming paradigms: modular programming and structured programming.
3. C language and the function main(). Source code and object code. The compiler and the interpreter.
4. Input/output exercises: human-computer interface. The standard input/output files: stdin, stdout. The #include<stdio.h> directive. Library functions. |
Lecture 2: Grammar and basic elements
of C language. |
1. The alphabet. Recursive derivations of sintactically valid sequences. Identifiers, numbers. Symbolic constants: The #define directive and macros. Use of the const qualifier.
2. Variables and their attributes: name, value, address, types. Pointer variables. Declaration of simple variables and pointers:
the direction & and reference * operators.
3. The sizeof operator. Arithmetical operators. The assignment operator. Automatic type conversion and by means of the cast operator.
4. Syntactic notation for expressions and statements. Simple and compound statements. |
Lecture 3: Sequential, iteration
and selection statements |
1. Evaluation of expressions with relational operators and boolean operators.
2. Decision statements: switch, if, nested if. The ternary operator (?:)
3. The iterative statements and their importance in modular programming: while, do while and for. The break and continue statements. |
Lecture 4: Arrays |
1. Declaration of array variables. Memory allocation for multidimensional arrays.
2. Unidimensional arrays and pointers: pointer arithmetic. Arrays of characters: the end of string character. Library functions for dealing with arrays of characters.
3.Variable length arrays in standard C99.
4. Dynamic memory allocation for 1 and 2 dimension arrays: the malloc(), calloc(), realloc() functions.
|
Lecture 6: struct variables |
1. struct variables: global declaration. Fields of a struct. Pointers to struct. The . (Point) and -> (arrow) operators.
2. struct and a pointer to struct as a funcion parameter and return value.
3. typedef with non trivial declarations.
4. More complex data structures: nested structs, array of structs.
5. Dynamic management in creating linear lists, circular lists and trees.
6. Insertion and removal of variables in a list. |