summaryrefslogtreecommitdiff
path: root/29_outname/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 /29_outname/README
Great C programming funHEADmaster
Excellent fundamentals and displine training, many tools and techniques exercises: gdb, emacs, valgrind, git
Diffstat (limited to '29_outname/README')
-rw-r--r--29_outname/README18
1 files changed, 18 insertions, 0 deletions
diff --git a/29_outname/README b/29_outname/README
new file mode 100644
index 0000000..735972e
--- /dev/null
+++ b/29_outname/README
@@ -0,0 +1,18 @@
+In a future assignment, you are going to write a program which reads
+some input, does some manipulations, and produces output in another file.
+Right now, you are going to write a function which will be useful to you
+in that assignment, which takes the input filename, and produces the output
+file name. The output file name should be the same as the input file name
+with ".counts" on the end. So, for example, if the input filename (inputName)
+is "input.txt", your function should return "input.txt.counts".
+
+Note that your function needs to use malloc to allocate memory to hold
+the string that it will return as its answer.
+
+Your function should have the following signature:
+
+ char * computeOutputFileName(const char * inputName)
+
+and you should write it in the outname.c file.
+You can make and test with the main function found in outname_test.c.
+As always, be sure your program valgrinds cleanly.