Basic C course
From scratch: everything you need to write your first programs. In DMarlon Studio, C is written in the console target: the studio compiles and runs with one click and shows errors on the line where they are.
Start- 1Hello, worldWrite your first C program: include stdio.h, create the main function and print text on the screen with printf, \n and \t.Lesson 1
- 2Variables and basic typesDeclare variables in C with the int, double and char types, change their values, use const and check with sizeof how many bytes each type takes.Lesson 2
- 3Arithmetic and castsDo maths in C: addition, subtraction, multiplication, integer division, the remainder with %, casts to double and int, and the += and ++ shortcuts.Lesson 3
- 4printf formatsMaster printf format specifiers in C: %d, %f, %c and %s, decimals with %.2f, column widths, %% and other formats for a shop receipt.Lesson 4
- 5Reading input with scanfAsk the user for data in C with scanf: words with %s, whole numbers with %d and decimals with %lf, and check how many values were read.Lesson 5
- 6Decisions with if and switchMake decisions in C with if, else if and else, and pick between several cases with switch, case, break and default: temperatures, scores and opening hours.Lesson 6
- 7Comparison and logicCompare values in C with ==, !=, < and >=, and combine conditions with &&, || and !. True is 1 and false is 0; plus the ?: ternary operator.Lesson 7
- 8while and do-while loopsRepeat code in C while a condition holds with while, and with do-while when the block must run at least once.Lesson 8
- 9for loopsUse C's for loop to count up and down, add things up, skip turns with continue, leave with break and nest one loop inside another.Lesson 9
- 10ArraysStore many values of the same type in a C array: a week of temperatures, their average and their maximum, with indexes that start at 0.Lesson 10
- 11Strings as char arraysWork with text in C as char arrays that end in '\0', using the string.h functions: strlen, strcpy, strcat and strcmp.Lesson 11
- 12FunctionsGroup code into C functions: void functions that return nothing, functions with a parameter and functions that give back a result with return.Lesson 12
- 13Parameters, returns and prototypesDeclare prototypes in C so functions can come after main, pass several parameters by value and use several return statements in one function.Lesson 13
- 14Scope and static variablesUnderstand where each variable lives in C: globals, locals, block variables and static ones, which keep their value between calls to a function.Lesson 14
- 15Pointers: address and valueLearn what a pointer is in C: a variable's address with &, its value with *, functions that change the caller's variables, and NULL.Lesson 15
- 16Pointers and arraysSee how pointers and arrays are related in C: the array name as an address, pointer arithmetic and arrays passed as function parameters.Lesson 16
- 17StructsGroup related data into a C struct: a shop's products with a name, price and stock, the dot, the arrow and pointers to structs.Lesson 17
- 18Enums and typedefName fixed values with enum in C and create short type names with typedef: a traffic light and the orders at a coffee shop.Lesson 18
- 19Writing and reading filesSave and read data in a text file in C with fopen, fprintf, fscanf and fclose, and add lines at the end with "a" mode.Lesson 19
- 20Project: a gradebookCombine everything from the C course in a gradebook: structs, arrays, an enum, functions, pointers and a report saved to a file.Lesson 20