summaryrefslogtreecommitdiff
path: root/02_code1/README
diff options
context:
space:
mode:
authorHaidong Ji2022-04-15 15:51:30 -0500
committerHaidong Ji2022-04-15 15:51:30 -0500
commit442a49ad5a48d417345959b903ae6a6d32d55759 (patch)
treec7127bb497e5e439018b1915e0136eec2c9cb124 /02_code1/README
Great C programming funHEADmaster
Excellent fundamentals and displine training, many tools and techniques exercises: gdb, emacs, valgrind, git
Diffstat (limited to '02_code1/README')
-rw-r--r--02_code1/README33
1 files changed, 33 insertions, 0 deletions
diff --git a/02_code1/README b/02_code1/README
new file mode 100644
index 0000000..49bd449
--- /dev/null
+++ b/02_code1/README
@@ -0,0 +1,33 @@
+Open the code1.c file you have in this directory.
+You will see two functions: max and main.
+
+In max, the algorithm is written as comments, but there is no code.
+You should translate this algorithm to code.
+
+In main, there are three print statements which call max and print
+its result. These would let you check if max is working right.
+
+There is also a comment asking you to write one more print statement
+with a call to max. In that comment, it asks you to take the max
+of two numbers (written as hex), and print them out.
+Add a line of code to do this.
+
+When you have done this, run
+
+./test.sh
+
+This script will try to compile your code (which you will learn about in
+the next chapter), as well as run it. If your code does not have legal
+syntax, it will do its best to describe what is wrong. If there
+is a problem, look at the code and try to see where you did not follow
+the syntax rules from chapter 2. The line number and message it gives
+may help you find the problem. If you cannot find the problem after a minute
+or two, ask for help.
+
+If your code has legal syntax, test.sh will also run it, and show
+you the output it produced, as well as the output we expected.
+
+If they are the same, you should commit, push, and grade.
+
+If they are not, you should see if you can fix the problem (and ask for help
+if you cannot).