Courses

C programming

C for electronics and computer engineering students, following Tom's units and the Ministry of Education curriculum (11.9006). Animated presentations, written lessons and practice questions with full answers, in English with key words in Hebrew.

Level: Grade 13, practical engineers. No programming experience needed

Start the course
  1. Arrays and strings

    Ten ADC channels in one array: indexes and bounds, walking the array with a loop, sum, average, minimum, maximum and counts, and strings as char arrays that end with the null terminator. Prepares lab experiments 10, 16 and 17.

    1. 1One-dimensional arraysMany sensor readings under one name: declaring and initializing an array, index and element, length and last index, walking the array with a loop, the off-by-one fault, reading input into an array, and walking backward, over a range and with a step.slideshow90 min
    2. 2Sensor data: sum, average, minimum, maximumComputing with an array of readings: the sum accumulator, the average with a cast, minimum and maximum from the first element, counting by a rule and counting occurrences, changes between neighbours, linear search, an array as a function parameter, a first sorting pass, and how to test it all. Prepares lab experiments 10 and 17.slideshow90 min
    3. 3Strings and charactersA C string is a char array that ends with the null terminator: capacity, walking a string to its end, length versus capacity, reading a line with fgets, the functions strlen, strcmp, strcpy and strcat, and classifying characters (lab experiment 16).slideshow90 min
    4. 4Practice: arraysQuestions 1 to 30 of unit 8: 14 short checks and 16 complete programs on indexes, bounds, sums, averages, extremes, counts and the ten-channel laboratory (lab experiments 10 and 17). Every answer is hidden until you open it.90 min
    5. 5Practice: traversal and stringsQuestions 31 to 46 of unit 8: strings in memory, traversal patterns (forward, backward, a range, a step, neighbours), string programs with fgets and string.h, character classification (lab experiment 16), a search function and a first bubble sort. Every answer is hidden until you open it.90 min
  2. Two-dimensional arrays

    Matrices in C: rows and columns, indexes and bounds, nested loops that visit every cell, row and column totals, the maximum and its position, the two diagonals and lab experiment 11, transpose, memory layout and functions.

    1. 1Rows, columns and nested loopsDeclare and initialize a matrix, reach any cell with a row index and a column index, stay inside the bounds, and visit every cell with two nested loops: read with scanf and print in neat columns.slideshow90 min
    2. 2Totals, maximum and countingThe same two loops with different jobs: the sum of all cells, the sum of one row and of one column, an average for every row, the maximum and where it is, and counting the cells that pass a test.slideshow90 min
    3. 3Diagonals, transpose and functionsSquare matrices and their two diagonals, lab experiment 11 (are the diagonals of a 10 × 10 array equal?), transpose, how a matrix sits in memory, passing a matrix to a function, common mistakes and how much work each operation takes.slideshow90 min
    4. 4Practice: 2D arrays, 30 short questionsTom's 30 short questions on two-dimensional arrays: sizes and indexes, nested loops, sums, diagonals, bounds, initialization, transpose and sensor grids. Every answer is hidden until you open it.45 min
    5. 5Practice: 2D arrays, programs and challengesTom's 40-question set on two-dimensional arrays: 12 fundamentals, 18 complete programs (sums, maximum, diagonals, transpose, matrix operations, searching) and 10 algorithm challenges. Every answer has the idea and a complete C17 program that compiles in Visual Studio.90 min