-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode_examples.html
More file actions
633 lines (599 loc) · 28.9 KB
/
Copy pathcode_examples.html
File metadata and controls
633 lines (599 loc) · 28.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Code Examples (School)</title>
<link rel="stylesheet" href="css/code.css">
</head>
<body>
<h3><a id="top">C Programming</a></h3>
<a href="#unit1">Unit 1: C Programming: Getting Started </a>
<ul>
<li> Unit 1.1: Printing, loops, and comments</li>
<li>Unit 1.2: Integers, variables and user input</li>
<li>Unit 1.3: Characters and doubles </li>
</ul>
<a href="#unit2">Unit 2: C Programming: Language Foundations </a>
<ul>
<li> Unit 2.1: Logic conditions and if-else statements</li>
<li> Unit 2.2: Arrays, for and while loops </li>
<li> Unit 2.3: Strings, sort and search algorithms </li>
</ul>
<a href="#unit3">Unit 3: C Programming: Modular Programming and Memory Management </a> <br>
<ul>
<li>Unit 3.1: Functions and recursion</li>
<li>Unit 3.2: Memory and the scope of variables</li>
<li>Unit 3.3: Pointers</li>
</ul>
<a href="#unit4">Unit 4: C Programming: Pointers and Memory Management </a> <br>
<ul>
<li>Unit 4.1: Memory and pointers</li>
<li>Unit 4.2: Multidimensional arrays</li>
<li>Unit 4.3: Dynamic memory allocation</li>
</ul>
<a href="#unit5">Unit 5: C Programming: Advanced Data Types </a> <br>
<ul>
<li>Unit 5.1: Structures</li>
<li>Unit 5.2: Structures and pointers</li>
<li>Unit 5.3: Linked lists</li>
</ul>
<a href="#unit6">Unit 6: Linux Basics: The Command Line Interface </a> <br>
<ul>
<li>Unit 6.1: History of Linux and the command line</li>
<li>Unit 6.2: The Linux file system</li>
<li>Unit 6.3: C program compilation with gcc</li>
</ul>
<a href="#unit7">Unit 7: C Programming: Using Linux Tools and Libraries </a> <br>
<ul>
<li>Unit 7.1: Libraries in C</li>
<li>Unit 7.2: Makefiles</li>
<li>Unit 7.3: File operations in C</li>
</ul>
<h3><a id="unit1">Unit 1: C Programming: Getting Started</a></h3>
<h4>Unit 1.1: Printing, loops, and comments <a href="#top"> top </a></h4>
<h5>Writing your first program</h5>
<ul>
<li><a href="/code/helloworld.c">"Hello World!" - write and compile</a></li>
</ul>
<h5>Correcting simple syntax errors</h5>
<ul>
<li><a href="/code/errors.c">Experience the effect of syntax errors</a></li>
</ul>
<h5>Printing text and new lines</h5>
<ul>
<li><a href="/code/print_txt.c">Print text and new lines</a></li>
<li><a href="/code/print_text.c">Activity: print text over several lines</a></li>
</ul>
<h5>Printing multiple lines with one printf statement</h5>
<ul>
<li><a href="/code/print_multilines.c">Printing multiple lines with one printf statement</a></li>
<li><a href="/code/print_ascii.c">Activity: create ASCII art by printing multiple lines</a></li>
</ul>
<h5>Printing quotation marks, escaping special characters</h5>
<ul>
<li><a href="/code/print_quotes_char.c">Printing quotation marks, escaping special characters</a></li>
<li><a href="/code/print_quotes.c">Activity: print special characters</a></li>
</ul>
<h5>Repeating one instrution with a for loop</h5>
<ul>
<li><a href="/code/print_forloop.c">Repeating one instruction with a for loop</a></li>
<li><a href="/code/print_loop.c">Activity: use a for-loop to print a line multiple times</a></li>
</ul>
<h5>Repeating a block of instructions with a for loop</h5>
<ul>
<li><a href="/code/loop_block.c">Repeating a block of instructions with a for loop</a></li>
<li><a href="/code/print_mloop.c">Activity: use multiple for-loops</a></li>
</ul>
<h5>Simple looping errors</h5>
<ul>
<li><a href="/code/loop_error.c">Discover the effects of simple looping errors</a></li>
<li><a href="/code/error_missbrace.c">Activity: correct simple errors with missing braces</a></li>
</ul>
<h5>Commenting your code</h5>
<ul>
<li><a href="/code/comment_line.c">Comment on one dedicated line</a></li>
<li><a href="/code/comment_end.c">Comment at the end of an instruction</a></li>
<li><a href="/code/comment_multiline.c">Comments over multiple lines</a></li>
<li><a href="/code/comment_comment.c">Comments inside comments</a></li>
<li><a href="/code/comment_code.c">Activity: add comments to existing code</a></li>
</ul>
<h5>Structure of a simple C program</h5>
<ul>
<li><a href="/code/program_structure.c">Structure a simple C program</a></li>
</ul>
<h4>Unit 1.2: Integers, variables and user input <a href="#top"> top </a></h4>
<h5>Printing and computing with integers</h5>
<ul>
<li>Use format specifier %d to print integer value</li>
<li>Perform simple integer arithmetic (+, -, *, ())</li>
<li><a href="/code/int_compute.c">Activity: perform simple arithmetic in C</a></li>
</ul>
<h5>Using variables</h5>
<ul>
<li>Store integers in variables</li>
<li>Change the value of a variable</li>
<li>Review: Declare and initialize integer variables</li>
<li>Activity: assign, re-assign and update a variable</li>
</ul>
<h5>Declaring and naming variables</h5>
<ul>
<li>Declare and initialize variables in 1-step</li>
<li>Name your variables: do's and don'ts</li>
<li>Correct common syntax erros involving variables</li>
<li>Activity: declare and name variables</li>
</ul>
<h5>Repeating instructions with variables</h5>
<ul>
<li>Use variables in loops</li>
<li> <a href="/code/var_loop.c">Activity: print the x8 multiplication table</a></li>
</ul>
<h5>Reading user input</h5>
<ul>
<li>Read integer user input using scanf()</li>
<li>Read multiple integers using one scanf() statement</li>
<li><a href="/code/var_read.c">Activity: read an integer and print the corresponding multiplication table</a></li>
</ul>
<h5>Reading user input inside a loop</h5>
<ul>
<li>Use scanf() inside a loop to read multiple user inputs</li>
<li><a href="/code/loop_read.c">Activity: read and process multiple integers via a loop</a></li>
</ul>
<h4>Unit 1.3: Characters and doubles <a href="#top"> top </a></h4>
<h5>Using Characters</h5>
<ul>
<li>Declare, assign and print characters with the %c format specifier</li>
<li><a href="/code/use_char.c">Activity: print characters with %c</a></li>
</ul>
<h5>Reading characters from the user input</h5>
<ul>
<li>Read characters from the user input</li>
<li><a href="/code/read_char.c">Activity: read characters from user input and produce ASCII art!</a></li>
</ul>
<h5>Using decimals</h5>
<ul>
<li>Declare, assign and print decimal numbers</li>
<li>Read decimal numbers from user input with scanf()</li>
<li>Read integers and doubles with scanf()</li>
<li>Read integers and doubles with one scanf() statement</li>
<li><a href="/code/read_decimal.c">Activity: read a decimal number</a></li>
</ul>
<h5>Dividing in C</h5>
<ul>
<li>Divide in C</li>
<li>Divide with integer and double variables</li>
<li><a href="/code/c_to_f.c">Activity: divide numbers</a></li>
</ul>
<h5>Finding the remainder</h5>
<ul>
<li>Find the remainder in integer division</li>
<li><a href="/code/div_remainder.c">Activity: find the remainder in integer division</a></li>
</ul>
<h5>Converting integers to decimals</h5>
<ul>
<li>Convert integers to double</li>
<li><a href="/code/int_double.c">Activity: convert integers to double</a></li>
</ul>
<h5>Converting decimals to integers</h5>
<ul>
<li>Convert double to integers</li>
<li><a href="/code/double_int.c">Activity: convert double to integers</a></li>
</ul>
<h5>Practicing division</h5>
<ul>
<li>Activity: divide decimals</li>
<li>Activity: divide decimals with round off</li>
</ul>
<h3><a id="unit2">Unit 2: C Programming: Language Foundations</a></h3>
<h4>Unit 2.1: Logic conditions and if-else statements <a href="#top"> top </a></h4>
<h5>Using the if statement</h5>
<ul>
<li>Use an if statement with a static condition</li>
<li>Use if and else with a static condition</li>
<li>Use an if statement with dynamic condition</li>
<li>Activity: if statements: carpooling</li>
<li>Activity: if statements: youth hostel</li>
</ul>
<h5>Comparing decimal numbers</h5>
<ul>
<li>Branch program flow using floating point numbers</li>
<li>Activity: if statements: bridge tax</li>
<li>Activity: if statements, Tug of War</li>
</ul>
<h5>Combining logic conditions using the logical AND and OR</h5>
<ul>
<li>Combine logical conditions using AND</li>
<li>Combine logical conditions using OR</li>
<li><a href="/code/logic_andor.c">Activity: more complex if statements: costly hotel rooms</a></li>
</ul>
<h5>Negating a logic condition using the logic operator NOT</h5>
<ul>
<li>Negate a logical condition using NOT</li>
<li>Branch using complex logical conditions</li>
<li><a href="/code/logic_not.c">Activity: if statements, name that tree</a></li>
</ul>
<h4>Unit 2.2: Arrays, for and while loops <a href="#top"> top </a></h4>
<h5>Using arrays of integers</h5>
<ul>
<li>Store integers in an array</li>
<li>Assign array elements from user input</li>
<li><a href="/code/int_array.c">Activity: store recipe ingredients in an array</a></li>
</ul>
<h5>Repeating instructions with a FOR loop</h5>
<ul>
<li>Explore details of the for loop</li>
<li>Store doubles in an array</li>
<li><a href="/code/array_loop.c">Activity: use an array to balance weights of train wagons</a></li>
</ul>
<h5>Using an IF statement inside a FOR loop</h5>
<ul>
<li>Find the largest array element</li>
<li>Compute with arrays</li>
<li><a href="/code/array_comploop.c">Activity: array computation, price per ingredient</a></li>
</ul>
<h5>Nesting IF and FOR</h5>
<ul>
<li>Nest IF and FOR</li>
<li><a href="/code/nest_forif.c">Activity: branch inside a loop, how many big cities?</a></li>
</ul>
<h5>Repeating inside repetition</h5>
<ul>
<li>Nest FOR loops</li>
<li><a href="/code/nested_loop.c">Activity: print a square of stars using nested loops</a></li>
</ul>
<h5>Repeating using a WHILE loop</h5>
<ul>
<li>Repeat instructions using a WHILE loop - introduction</li>
<li>Repeat using a WHILE loop</li>
<li><a href="/code/repeat_while.c">Activity: compute budget using a while loop, university expenses</a></li>
</ul>
<h5>Efficiently using a WHILE loop</h5>
<ul>
<li>Check a logic statement to continue looping</li>
<li><a href="/code/check_while.c">Activity: controlling an epidemic using a while loop</a></li>
</ul>
<h5>Practicing WHILE loops</h5>
<ul>
<li>Activity: guess my number</li>
<li>Activity: monitoring a chemical experiment</li>
</ul>
<h4>Unit 2.3: Strings, sort and search algorithms <a href="#top"> top </a> </h4>
<h5>Using strings (arrays of characters)</h5>
<ul>
<li>Store, print and read strings as arrays of characters</li>
<li><a href="/code/read_string.c">Activity: repeat a word from the user input</a></li>
</ul>
<h5>Using the special null terminator (\0) to identify the end of a string</h5>
<ul>
<li>Explain the null terminator \0</li>
<li><a href="/code/end_string.c">Activity: swap first and last name</a></li>
</ul>
<h5>Finding the length of a string</h5>
<ul>
<li>Find the length of a string</li>
<li><a href="/code/str_length.c">Activity: even or odd number of letters in a word?</a></li>
</ul>
<h5>Working with string lengths</h5>
<ul>
<li>Find the frequencies of word lengths</li>
<li><a href="/code/longest_str.c">Activity: find the longest word in a text</a></li>
</ul>
<h5>Sorting strings</h5>
<ul>
<li>Sort strings alphabetically</li>
<li>Search for a number in an array using linear search</li>
<li><a href="/code/sort_string.c">Activity: is there a 't' in this word?</a></li>
</ul>
<h5>Searching with bisection and sorting with bubble sort</h5>
<ul>
<li>Search for a number in a sorted list using bisection</li>
<li>Sort an array using bubble sort</li>
<li><a href="/code/bubblesort.c">Activity: find repeat letters in a word</a></li>
</ul>
<h3><a id="unit3">Unit 3: C Programming: Modular Programming and Memory Management</a></h3>
<h4>Unit 3.1: Functions and recursion <a href="#top"> top </a></h4>
<h5>Defining functions and passing values to functions</h5>
<ul>
<li><a href="/code/function_integersum.c">Write a function: the sum of 2 integers</a></li>
<li><a href="/code/function_parameter_argument.c">Differentiate parameters and arguments of a function</a></li>
<li><a href="/code/function_prototype_definition.c">Differentiate the prototype and the definition of a function</a></li>
</ul>
<h5>Working with functions</h5>
<ul>
<li><a href="/code/function_multiple.c">Decompose a problem into multiple functions</a></li>
<li><a href="/code/function_error.c">Correct basic compilation errors with functions</a></li>
<li><a href="/code/converter_program.c">Activity: program a smart unit converter</a></li>
<li><a href="/code/find_smallest_program.c">Activity: find the smallest integer</a></li>
</ul>
<h5>Using recursion</h5>
<ul>
<li><a href="/code/function_recursion_factorial.c">Use recursion to make a function use itself: the factorial example</a></li>
<li><a href="/code/function_factorial_recursion.c">Use recursion to make a function use itself: the recursive factorial example</a></li>
<li><a href="/code/function_recursion_fibonacci.c">Use recursion to make a function use itself: the Fibonacci example</a></li>
<li><a href="/code/recursion.c">Activity: use recursion to compute the sum of digits </a></li>
</ul>
<h4>Unit 3.2: Memory and the scope of variables <a href="#top"> top </a></h4>
<h5>Understanding computer memory</h5>
<ul>
<li>Discover the Von Neumann architecture <a href="/files/von Neumann-en.txt">text</a> <a href="/videos/DRTHLSWX2017-V018500_DTH.mp4">video</a></li>
<li>Memory representation, RAM, cells, word, byte, bit, memory address <a href="/files/memory representation-en.txt">text</a> <a href="/videos/DRTHLSWX2017-V018600_DTH.mp4">video</a></li>
</ul>
<h5>Determining the amount of memory used for different data types</h5>
<ul>
<li><a href="/code/size_datatypes.c">Get and print the size of basic types</a></li>
<li><a href="/code/space_codes_program.c">Activity: compute space for tracking codes</a></li>
<li><a href="/code/int_largest.c">Be aware of the largest possible value for an integer!</a></li>
<li><a href="/code/num_round.c">Round off numbers and circumvent errors</a></li>
<li><a href="/code/memory_program.c">Activity: programming a toaster (memory usage nicely displayed)</a></li>
</ul>
<h5>Determining the scope of variables</h5>
<ul>
<li><a href="/code/memory_stack.c">Visualize what happens in the stack of the memory with code</a></li>
<li><a href="/code/var_blocks.c">Scope and blocks in C: scope of variables when using blocks</a></li>
<li><a href="/code/var_functions.c">Scope and functions in C: scope of variables when using functions</a></li>
</ul>
<h4>Unit 3.3: Pointers <a href="#top"> top </a></h4>
<h5>Defining pointers and dereferencing pointers</h5>
<ul>
<li><a href="/code/pointer_address.c">Get and print the address of a variable using pointers</a></li>
<li><a href="/code/pointer_dereference.c">Dereference a pointer: get the value stored at a specific address</a></li>
<li><a href="/code/def_pointer.c">Activity: pointers</a></li>
</ul>
<h5>Using pointers with function</h5>
<ul>
<li><a href="/code/ptr_intswap_func.c">Swap two integer variable values using functions and pointers</a></li>
<li><a href="/code/ptr_intmod_func.c">Modify an integer variable value using a function with pointers</a></li>
<li><a href="/code/ptr_function.c">Activity: pointers and functions</a></li>
</ul>
<h5>Performing simple pointer arithmetic</h5>
<ul>
<li><a href="/code/pointer_arithmetic.c">Introduction to pointer arithmetic: arrays, addresses and pointers</a></li>
</ul>
<h5>Passing arrays to functions</h5>
<ul>
<li><a href="/code/ptr_array_function.c">Pass an array to a function</a></li>
<li><a href="/code/array_function.c">Activity: arrays and functions</a></li>
</ul>
<h3><a id="unit4">Unit 4: C Programming: Pointers and Memory Management</a></h3>
<h4>Unit 4.1: Memory and pointers <a href="#top" class="top"> top </a></h4>
<h5>Defining and dereferencing pointers</h5>
<ul>
<li><a href="https://www.youtube.com/watch?v=_8-ht2AKyH4" target="_blank">The stack: visualize what happens in memory</a></li>
<li><a href="/code/addresses.cxx">Find the address of a variable</a></li>
<li><a href="/code/deref_ptr.cxx">Dereference a pointer</a></li>
</ul>
<h5>Using pointers with functions</h5>
<ul>
<li><a href="/code/func_ptr.cxx">Pass pointers to functions</a></li>
<li><a href="/code/func_var_ptr.cxx">Pass variables to functions by reference</a></li>
</ul>
<h5>Working with pointer arithmetic</h5>
<ul>
<li><a href="/code/array_ptr.cxx">Pointer arithmetic</a></li>
</ul>
<h5>Passing arrays to functions</h5>
<ul>
<li><a href="/code/array_ptr_func.c">Pass arrays to functions</a></li>
<li><a href="/code/array_to_function.c">Activity: arrays and functions</a></li>
</ul>
<h4>Unit 4.2: Multidimensional arrays <a href="#top" class="top"> top </a></h4>
<h5>Working with arrays and pointers</h5>
<ul>
<li><a href="/code/dereference.c">Define and work with arrays of pointers and use multiple ways for dereferencing</a></li>
<li><a href="/code/ptr_ptr_deref.c">Use pointers to pointers and dereference</a></li>
<li><a href="/code/multi_array.c">Activity: array and memory</a></li>
</ul>
<h5>Storing and manipulating strings in arrays</h5>
<ul>
<li><a href="/code/str_array_ptrs.c">Store strings in arrays using pointers</a></li>
<li><a href="/code/multistr_array.c">Store multiple strings in an array</a></li>
<li><a href="/code/matrices.c">Work with matrices</a></li>
<li><a href="/code/str_array.c">Activity: print a text in reverse order</a></li>
</ul>
<h4>Unit 4.3: Dynamic memory allocation <a href="#top" class="top"> top </a></h4>
<h5>Allocating memory at runtime</h5>
<ul>
<li><a href="/code/malloc_heap.c">Allocate memory in the heap using malloc</a></li>
</ul>
<h5>Freeing dynamically allocated memory</h5>
<ul>
<li><a href="/code/free_memory.c">Deallocate memory in the heap using free</a></li>
</ul>
<h5>Storing and addressing arrays in dynamically allocated memory</h5>
<ul>
<li><a href="/code/malloc_array.c">Allocate memory for arrays using malloc</a></li>
<li><a href="/code/malloc_ex.c">Learn from another example of array memory allocation</a></li>
<li><a href="/code/str_memory.c">Activity: allocate memory for storage</a> </li>
</ul>
<h3><a id="unit5">Unit 5: C Programming: Advanced Data Types</a></h3>
<h4>Unit 5.1: Structures <a href="#top" class="top"> top </a></h4>
<h5>Define structures</h5>
<ul>
<li><a href="/code/structures.c">Define and use structures</a></li>
</ul>
<h5>Access and modify structures</h5>
<ul>
<li><a href="/code/struct_dot.c">Access and modify structure's members with the dot operator</a></li>
</ul>
<h5>Pass structures to functions</h5>
<ul>
<li><a href="/code/struct_func.c">Pass structures to functions directly</a></li>
<li><a href="/code/struct_func_ptr.c">Pass structures to functions with pointers</a></li>
<li><a href="/code/struc_func.c">Activity: pass structures to functions</a></li>
</ul>
<h5>Work with structures</h5>
<ul>
<li><a href="/code/struct_arrow.c">Access and modify structure's members with the arrow operator</a></li>
<li><a href="/code/struct_mem.c">Get the size of a structure in memory</a></li>
<li><a href="/code/struc_manip.c">Activity: manipulate structures with functions</a></li>
</ul>
<h4>Unit 5.2: Structures and pointers <a href="#top" class="top"> top </a></h4>
<h5>Create a structure to store the coordinates of a point</h5>
<ul>
<li><a href="/code/struct_input.c">Create structures from user input</a></li>
<li><a href="/code/struct_array.c">Use an array of structures</a></li>
</ul>
<h5>Allocate memory for structures</h5>
<ul>
<li><a href="/code/struct_malloc.c">Allocate memory for structures</a></li>
<li><a href="/code/struc_memory.c">Activity: allocate memory for structures</a></li>
</ul>
<h5>Get to know the concept of a linked list</h5>
<ul>
<li><a href="/code/struct_linklist.c">Link structures together in a linked list</a></li>
<li><a href="/code/linkedlist_print.c">Print a linked list</a></li>
<li><a href="/code/linkedlist_append.c">Append new nodes to a linked list</a></li>
<li><a href="/code/linkedlist_delete.c">Delete a linked list</a></li>
</ul>
<h4>Unit 5.3: Linked lists <a href="#top" class="top"> top </a></h4>
<h5>Creating a single node</h5>
<ul>
<li><a href="/code/linkedlist_node.c">Create a node of a linked list</a></li>
<li><a href="/code/llist_node.c">Activity: create a node to store student data</a></li>
</ul>
<h5>Linking nodes</h5>
<ul>
<li><a href="/code/linkedlist_nodelink.c">Append a node to a linked list</a></li>
<li><a href="/code/ll_node_append.c">Activity: append a node with student data</a></li>
</ul>
<h5>Printing a linked list</h5>
<ul>
<li><a href="/code/ll_print.c">Print a linked list</a></li>
<li><a href="/code/ll_print_student.c">Activity: print a linked list of student data</a></li>
</ul>
<h5>Free an entire linked list</h5>
<ul>
<li><a href="/code/linkedlist_free.c">Free all space allocated for a linked list</a></li>
<li><a href="/code/ll_free_student.c">Activity: free a linked list of students</a></li>
</ul>
<h5>Creating linked lists from user input</h5>
<ul>
<li><a href="/code/linkedlist_input.c">Create a linked list of digits from user input</a></li>
<li><a href="/code/llist_input.c">Activity: is the number divisible by 3?</a></li>
</ul>
<h5>Searching a linked list</h5>
<ul>
<li><a href="/code/linkedlist_search_node.c">Search for a node in a linked list</a></li>
<li><a href="/code/llist_search.c">Activity: update nodes in a linked list</a></li>
</ul>
<h5>Sorting a linked list using Insertion Sort</h5>
<ul>
<li><a href="/code/linkedlist_insert_node_start.c">Insert a new node at the start of a linked list</a></li>
<li><a href="/code/linkedlist_sort.c">Create a sorted copy of a linked list</a></li>
<li><a href="/code/llist_sort.c">Activity: count redundancies in number</a></li>
</ul>
<h3><a id="unit6">Unit 6: Linux Basics: The Command Line Interface</a></h3>
<h4>Unit 6.1: History of Linux and the command line <a href="#top" class="top"> top </a></h4>
<h5>Discovering operating systems</h5>
<ul>
<li><a href="/files/C106_genesis of OS-en.txt">Operating systems genesis: definition, services (files, memory, processes), key dates</a></li>
<li><a href="/files/C106_history UNIX-en.txt">UNIX genesis: MAC project @ MIT, MULTICS, Thompson & Ritchie</a></li>
<li><a href="/files/C106_history LINUX-en.txt">Linux genesis and history: GNU, Stallman, GPL, Linus Torvalds, Linux</a></li>
</ul>
<h5>Manipulating the command line interface</h5>
<ul>
<li><a href="/files/C106_command line-en.txt">Command line interface, prompt, command options and files data, command cal as example</a></li>
<li><a href="/files/MOOC106_W1_9s-en.txt">First commands: echo 'hello world', date, cal, history, whoami, hostname, uptime, clear, command not found, man, command options</a></li>
<li><a href="/files/MOOC106_W1_11s-en.txt">Interactive commands: top, htop, nano, vim, how to get back to the prompt</a></li>
<li><a href="/files/MOOC106_W1_12s-en.txt">Play with commands: hello, worm, firework, rain, hanoi</a></li>
</ul>
<h4>Unit 6.2: The Linux file system <a href="#top" class="top"> top </a></h4>
<h5>Discovering the file system</h5>
<ul>
<li><a href="/files/C106_file system-en.txt">Filesystem, history, FSSTND, /bin, /sbin, /home, /root, /etc, /lib, /tmp, /var, /usr, /dev</a></li>
<li><a href="/files/MOOC106_W2_2_0s-en.txt">pwd, cd, ls, absolute path, relative path</a></li>
<li><a href="/files/MOOC106_W2_2_1s-en.txt">pwd, cd, ls, absolute path, relative path (2)</a></li>
</ul>
<h5>Creating and deleting files and folders</h5>
<ul>
<li><a href="/files/MOOC106_W2_5s-en.txt">Touch, rm, names wth spaces</a></li>
<li><a href="/files/MOOC106_W2_6_1_s-en.txt">cat less</a></li>
<li><a href="/files/MOOC106_W2_7s-en.txt">mkdir, rm -r</a></li>
</ul>
<h5>Unblocking yourself in the command line</h5>
<ul>
<li><a href="/files/MOOC106_W2_9s-en.txt">Unblock yourself in the command line</a></li>
</ul>
<h5>Modifying, moving and copying files and folders</h5>
<ul>
<li><a href="/files/MOOC106_W2_11s-en.txt">mv: rename and move</a></li>
<li><a href="/files/MOOC106_W2_12s-en.txt">cp, cp -r</a></li>
</ul>
<h5>Searching files and folders</h5>
<ul>
<li><a href="/files/MOOC106_W2_15s-en.txt">Find locate</a></li>
</ul>
<h4>Unit 6.3: C program compilation with gcc <a href="#top" class="top"> top </a></h4>
<h5>Compiling C programs under Linux</h5>
<ul>
<li><a href="/files/C106_compile VS interpreter-en.txt">Difference between interpreter and compiler</a></li>
<li><a href="/files/MOOC106_W3_2s-en.txt">Compile a C program automatically on Weblinux</a></li>
<li><a href="/files/MOOC106_W3_3s-en.txt">Compile a C program using GCC</a></li>
</ul>
<h5>Managing memory with Linux</h5>
<ul>
<li><a href="/files/memory representation-en.txt">Memory representation, RAM, cells, word, byte, bit, memory address</a></li>
<li><a href="/files/MOOC106_W3_5s-en.txt">Manage the memory with the command line: free, top, htop</a></li>
<li><a href="/files/MOOC106_W3_6_1s-en.txt">Memory consumption of a program using htop, virtual memory</a></li>
<li><a href="/files/MOOC106_W3_6_2s-en.txt">Reboot Weblinux if needed</a></li>
</ul>
<h5>Scanf and interactive programs in C</h5>
<ul>
<li><a href="/files/MOOC106_W3_8s-en.txt">Interactive programs in C using scanf, fflush</a></li>
<li><a href="/files/MOOC106_W3_9s-en.txt">Use scanf and file redirection to simulate an input</a></li>
<li><a href="/files/MOOC106_W3_10s-en.txt">Don't use scanf, use fgets getline or readline</a></li>
</ul>
<h3><a id="unit7">Unit 7:</a> C Programming: Using Linux Tools and Libraries</h3>
<h4>Unit 7.1: Libraries in C <a href="#top" class="top"> top </a></h4>
<h5>Declaring and defining functions</h5>
<ul>
<li><a href="/files/W1_1_sdeclareDefineFunction-en.txt">Distinguish between function declaration and the function definition</a></li>
<li><a href="/code/func_declare_define.c">Activity: distinguish between function declaration and function definition</a></li>
</ul>
<h5>Using the math library in C</h5>
<ul>
<li><a href="/files/W1_3-en.txt">Use the math library</a></li>
<li><a href="/code/library_math.c">Activity: use the math library</a></li>
</ul>
<h5>Using multiple libraries in C</h5>
<ul>
<li><a href="/files/W1_5_smultipleLibraries-en.txt">Use multiple libraries in C</a></li>
<li><a href="/code/library_jpeg.c">Activity: using the JPEG library</a></li>
</ul>
<h4>Unit 7.2: Makefiles <a href="#top" class="top"> top </a></h4>
<h5>Modularizing a program</h5>
<ul>
<li><a href="/files/W2_1_screateYourLibrary-en.txt">Create and use your own library</a></li>
<li><a href="/files/W2_2_smodifyYourLibrary-en.txt">Modify your own library</a></li>
<li><a href="/code/library_create.c">Activity: create and modify your own library</a></li>
</ul>
<h5>Creating and using a Makefile</h5>
<ul>
<li><a href="/files/W2_4_smakeFile-en.txt">Automate the compilation and linking steps with a Makefile</a></li>
<li><a href="/files/W2_5_srunProgramWithMakefile-en.txt">Run a program with a Makefile</a></li>
<li><a href="/files/makefile">Activity: create and use a Makefile</a></li>
</ul>
<h4>Unit 7.3: File operations in C <a href="#top" class="top"> top </a></h4>
<h5>Using arguments for main()</h5>
<ul>
<li><a href="/files/W3_1_sgetArgumentsFromCommandLine-en.txt">Pass arguments to a program from the command line</a></li>
<li><a href="/files/W3_2_suseArgumentsFromTheCommandLine-en.txt">Use arguments passed to a program from the command line</a></li>
<li><a href="/code/cl_program.c">Activity: pass numbers to a program from the command line</a></li>
</ul>
<h5>Reading from a file</h5>
<ul>
<li><a href="/files/W3_4_sreadNumbersFromFile-en.txt">Read numbers (integers and doubles) from a file using fscanf()</a></li>
<li><a href="/code/file_read.c">Activity: read numbers from a file</a></li>
</ul>
<h5>Reading until the end of the file</h5>
<ul>
<li><a href="/files/W3_6_sreadUntilEOF-en.txt">Read until the end of the file</a></li>
<li><a href="/code/file_read_eof.c">Activity: find the end of the file</a></li>
</ul>
<h5>Writing to a file</h5>
<ul>
<li><a href="/files/W3_8_swriteToFile-en.txt">Write numbers to a file using fprintf()</a></li>
<li><a href="/files/W3_9_sappendToFile-en.txt">Append numbers to a file at the end</a></li>
<li><a href="/code/file_write.c">Activity: write numbers to a file</a></li>
</ul>
</body>
</html>