This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tech:tutorial:start [2016/11/07 15:31] rk4n3 |
tech:tutorial:start [2017/01/16 00:18] (current) admin |
||
---|---|---|---|
Line 7: | Line 7: | ||
* It is expected that exercises will compel a learner to ask questions, so anyone using this tutorial content should do so while having someone they feel comfortable asking about places they might get stuck on. | * It is expected that exercises will compel a learner to ask questions, so anyone using this tutorial content should do so while having someone they feel comfortable asking about places they might get stuck on. | ||
- | ==== Resources ==== | + | [[tech:tutorial:c_basic|Basic C Tutorial]] |
- | Here are the locations of existing free tutorial content that I have reviewed, and seen fit to refer to: | + | * [[tech:tutorial:c_pointer_cheatsheet|Basic pointer reference card]] |
- | * [[https://www.tutorialspoint.com/cprogramming|TutorialsPoint C tutorial]] | + | |
- | ===== C Programming ===== | + | [[tech:tutorial:c_intermediate|Intermediate C Tutorial]] |
- | ==== Exercise 1 ==== | + | [[tech:tutorial:vid:start|Content for Videos]] |
- | The first portion of this exercise is to complete the [[https://www.tutorialspoint.com/cprogramming/c_environment_setup.htm|TutorialsPoint C-Environment Setup tutorial phase]] (but skip the "Try It Option Online" part). \\ | + | |
- | Once that is complete, proceed with: | + | |
- | * Make sure you have the "Hello world" program from TutorialsPoint in a ''.c'' file | + | |
- | * Compile your program (you can use [[https://www.tutorialspoint.com/cprogramming/c_program_structure.htm|this step]] if you like) | + | |
- | * Read the man page for the GNU ''make'' command | + | |
- | * Write a ''Makefile'' to build your program | + | |
- | * Ensure your ''Makefile'' also supports a ''clean'' target, which removes products of compilation | + | |
- | * Test out all aspects of your ''Makefile'' to ensure it operates as expected | + | |
- | Remember to have your work reviewed by, as well as to seek help/advice from, your instructor. | + | |
- | Here is a sample Makefile as a kick-start: | ||
- | <code> | ||
- | PGM = hello | ||
- | all : $(PGM) | ||
- | @echo Done | ||
- | |||
- | clean : | ||
- | @rm -f *.o | ||
- | |||
- | $(PGM) : hello.c | ||
- | gcc -o $(PGM) hello.c | ||
- | </code> | ||
- | |||
- | ==== Exercise 2 ==== | ||
- | Read these sections in the TutorialsPoint tutorial: | ||
- | * [[https://www.tutorialspoint.com/cprogramming/c_basic_syntax.htm|Basic Syntax]] | ||
- | * [[https://www.tutorialspoint.com/cprogramming/c_data_types.htm|Data Types]] | ||
- | * [[https://www.tutorialspoint.com/cprogramming/c_variables.htm|Variables]] | ||
- | |||
- | ... then, read the manpage for ''printf''. \\ | ||
- | |||
- | Once complete with these readings, write a program that stores integer values in four different integer variables, and prints each out using the ''printf'' function, making sure the name of the variable is shown before the value. \\ | ||
- | Once you have completed that, read [[https://www.tutorialspoint.com/cprogramming/c_operators.htm|this TutorialsPoint section]], and then alter your program to do a number of typical arithmetic operations upon your variables, printing out both a label showing the calculation being done and the result for each. | ||
- | |||
- | ==== Exercise 3 ==== | ||
- | Read these sections in the TutorialsPoint tutorial: | ||
- | * [[https://www.tutorialspoint.com/cprogramming/c_decision_making.htm|Decision Making]] | ||
- | * [[https://www.tutorialspoint.com/cprogramming/c_loops.htm|Loops]] | ||
- | ... then, alter your program to start with one number (as one of your variables), and compute the result of ''n<sup>2</sup> - 1'' for ''n'' up to a higher number (as another of your variables). Make sure that the calculation being performed and the result are printed for each iteration. \\ | ||
- | |||
- | When that program is complete, read [[https://www.tutorialspoint.com/cprogramming/c_functions.htm|this TutorialsPoint section]], and then move your calculations into a function that takes the beginning and ending for your loop as parameters. | ||
- | |||
- | ==== Exercise 4 ==== | ||
- | Read this section in the TutorialsPoint tutorial: | ||
- | * [[https://www.tutorialspoint.com/cprogramming/c_arrays.htm|Arrays]] | ||
- | ... then, refactor your program to use an array of integers for ''n'', and perform the calculation for each of the ''n'' in the array. \\ | ||
- | |||
- | Once that is complete and working, read [[https://www.tutorialspoint.com/cprogramming/c_strings.htm|this section at TutorialsPoint]], and then add a new function that creates a string, fills it with some text, and then iterates over the string to print each character out on a separate line. | ||
- | |||
- | ==== Exercise 5 ==== | ||
\\ | \\ | ||
// Links: [[:tech:start|Tech Info]] ... [[:mantis:start|Mantis Area]] // | // Links: [[:tech:start|Tech Info]] ... [[:mantis:start|Mantis Area]] // | ||