Course: Introduction to Programming in the C Language

» List of faculties » PRF » KI
Course title Introduction to Programming in the C Language
Course code KI/UPC
Organizational form of instruction Seminary
Level of course Bachelor
Year of study not specified
Semester Summer
Number of ECTS credits 2
Language of instruction Czech
Status of course Compulsory-optional
Form of instruction Face-to-face
Work placements This is not an internship
Recommended optional programme components None
Lecturer(s)
  • Burle Jan, Ing. PhD
Course content
1. Introduction to C and program structure History of C, its philosophy and use. First program "Hello World." Basic data types, variables, constants. Arithmetic operators, type conversions, operator precedence. Representation of numbers, overflow. Program compilation and linking. Standard input and output. 2. Program flow control, control structures Conditions, switches, loops. Logical operators and relational expressions. Nesting control structures. Bitwise operators. Code debugging. 3. Functions and program structure Definition, declaration, and calling of functions. Parameters and return values. Scope of variables. Recursion. Modular program structure. Preprocessor, header files, conditional compilation. Standard C library. 4. Pointers, arrays, strings One-dimensional arrays. Relationship between arrays and pointers. Pointer arithmetic. Pointers as function arguments (call by reference). Working with strings as character arrays. Standard functions for working with strings. 5. Multidimensional arrays, pointers to functions Arrays of pointers vs. multidimensional arrays. Pointers to functions as a tool for abstraction. Command line arguments. 6. Input and output Standard library `stdio.h`. Standard streams (stdin, stdout, stderr). Formatted input and output. Working with files. Chaining inputs and outputs. 7. Data structures and memory management Composite data types. Structure definitions, nested structures, arrays of structures. Static and dynamic memory allocation. Data lifecycle. Common memory errors (memory leaks). 8. Project I: Forth Language Interpreter - Core Principles of programming language interpreters. Stack model of computation. Basic concepts of the Forth language. Data and return stack, word dictionary, internal interpreter loop. Text parsing. 9. Project I: Forth language interpreter - logic and control Implementation of basic words (arithmetic, working with the stack). Definition of new words. Conditions and loops. 10. Project II: Turtle graphics in Forth - core Graphical interface. Definition of Forth words for turtle control. 11. Project II: Turtle graphics in Forth - application Connecting the interpreter with the drawing module. Drawing iterative and recursive structures. 12. Project III: C and Python - integration Creating a simple Python library in C. 13. Miscellaneous Summary of the course. Discussion of project solutions.

Learning activities and teaching methods
unspecified
Learning outcomes
The aim of the course is to familiarize students with the basics of programming in the C language in the spirit of the classic K&R (Kernighan & Ritchie) approach. The course emphasizes understanding low-level programming principles, working with memory, data types, and code efficiency. The theoretical foundations are supported by practical examples and exercises. At the end of the course, sample projects will be created: a minimalist Forth language interpreter and its use in a turtle graphics application.

Prerequisites
unspecified
KI/APR2
----- or -----
KI/KAPR2

Assessment methods and criteria
unspecified
active participation in seminars and continuous completion of assignments related to the subject matter
Recommended literature
  • https://www.cprogramming.com/.
  • https://www.learn-c.org.
  • https://archive.org/details/cprogramminglang0000kern_2ed. .
  • https://dn710204.ca.archive.org/0/items/the-c-programming-language-second-edition-first-190-pages.
  • https://www.learn-c.org. .
  • Learn C and C++ Programming. .
  • Brian W. Kernighan, Dennis M. Ritchie. The C Programming Language.
  • Brian W. Kernighan, Dennis M. Ritchie. The C Programming Language. .


Study plans that include the course
Faculty Study plan (Version) Category of Branch/Specialization Recommended year of study Recommended semester