C Programming

02.03.01, Mathematics and Artificial Intelligence

Attention!

Caution!

You have a lecturer from the Department of Software Engineering, but probably have not yet completed the survey 'Let's get acquainted'? This is a very dangerous situation. Don't wait for (and if) the instructor to say. Fill in!

Materials

Distant Learning

  • MS Teams team code: 6v9salf and link

Homework

0. Git repository

  1. Number guess. You should define a range, e.g. 1 to 1000. The program should ask user to think of a number. Then the program should ask the user repeatedly if the number is greater than some X, than Y, etc. until it guesses a number. Then it should print the number out. Note that you are free to decide if to split your range by 2 each time or widen it to the power of 2 first, and the program should always ask the same question like 'is is greater than X', but, if you do not like asking about greater you can ask about 'less than X' — it will finally make no difference =).

  2. Change 04.Arrays_Strings/arrays2.c a tiny bit to slow it down dramatically by causing a cache thrashing.

Agenda Draft

  1. C Programming language reasoning and history. Operating enviroment: generic Unix-like (Linux), others (Windows + Cygwin,MSYS2,MSVC). 'Hello World' program.

  2. Built-in data types: char, int, float, double. Control flow: operators, functions, comments, cycles.

  3. Macros. Arrays and strings. Character encodings.

  4. Structures and unions.

  5. Module system. Includes. Libraries.

  6. Input and output. Standard library modules. POSIX modules. What was new in C99, C11, C17.

  7. Utilities: 'make'; IDEs; debuggers; profilers.

  8. C and Python. python.h.

  9. Sorting and searching arrays.

  10. Trees and graphs.

  11. Cross-compiling C programs.

References

  1. Ivor Horton. Beginning C. From Novice to Professional. APress: 2006.

  2. Jeri N. Hanly, Elliot B. Koffman. Problem Solving and Program Design in C. Pearson Education: 2007.

  3. Kyle Loudon. Mastering Algorithms with C. O'Really: 1999.

  4. Brian W. Kernighan, Dennis M. Ritchie. The C Programming Language. Prentice Hall: 1988

C Programming