This course provides students with the basic abilities needed to write programs in the C programming language. The relationship between the programming language and the underlying machine is highlighted. The concept of recursion is put in evidence, as well as the implementation of simple data structures, both recursive and non-recursive.
At the end of the course, the students will be able to develop and to organize programs in C language and they will know how to:
-) implement algorithms of medium complexity;
-) analize and debug C code.
• Fundamental concepts: programming, high-level languages, operating systems, program compiling.
• Compiling and execution of the first program: first program compiling, first program execution, first program description, variable visualization, comments.
• Variables, data types and arithmetic expressions: operating with variables, data types and constants, operating with arithmetic expressions, combining operations with assignment – assignment operators.
• Iteration: for instruction, while instruction, do instruction.
• Taking decisions: if instruction, switch instruction, Boolean variables, conditional statement.
• Statements with arrays: array definition, array initialization, arrays of chars, multidimensional arrays.
• Functions: function definition, arguments and local variables, returning results of a function, functions that call functions that calling functions…, top-down programming, functions and arrays, global variables, automatic and static variables, recursive functions.
• Structures: a structure for data storing, functions and structures, structure initialization, array of structures, structures containing structures, structures containing arrays, variants of structures.
• Strings of chars: arrays of chars, strings of chars of variable length, escape sequences, other information of constant strings, char strings, structures and arrays, operations with chars.
• Pointers: pointer definition, using pointers in expressions, pointers and structures, pointers and functions, pointers and arrays, operations on pointers, pointers and memory addresses.
• The preprocessing: #define directive, #include directive, conditional compiling.
• Input/Output operations: I/O of chars – getchar and putchar, printf and scanf
• Advanced characteristics: comma operator, dynamic memory allocation.
• Introduction, file system, bash, editor.
• Practical programming in lab by applying all the arguments explained in the theory part: examples, exercises.
• Code debugging: gdb, ddd, and CodeBlocks.
Assessment methods and criteria
The exam, unified with the Laboratory module, consists in two parts, that will take place around February (first part) and June (second part). The final global mark will be the composition (average) of the marks of the two parts. Students who do not pass these partial exams can try again in the normal 4 examinations scattered around the year, starting from June. Those exams are on the total program of the course.
The exams (partial as well as total) verify the ability in writing simple programs to the computer, in lab.
To pass the exam, the students have to show:
- they have understood the principles related to the programming in C language
- they are able to develop C code and to analyze its correctness and problems through debugging
- they are able to apply the acquired knowledge to implement algorithms in C code by starting from specifications given as exercises.
The emphasis in the evaluation will be given to the ability to organize algorithms and data structures and to translate them into the C language with no significant syntactical errors.