From 442a49ad5a48d417345959b903ae6a6d32d55759 Mon Sep 17 00:00:00 2001 From: Haidong Ji Date: Fri, 15 Apr 2022 15:51:30 -0500 Subject: Great C programming fun Excellent fundamentals and displine training, many tools and techniques exercises: gdb, emacs, valgrind, git --- 29_outname/outname.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 29_outname/outname.c (limited to '29_outname/outname.c') diff --git a/29_outname/outname.c b/29_outname/outname.c new file mode 100644 index 0000000..7cc4346 --- /dev/null +++ b/29_outname/outname.c @@ -0,0 +1,11 @@ +#include +#include +#include +#include "outname.h" + +char * computeOutputFileName(const char * inputName) { + char * outFileName = malloc((strlen(inputName) + 8) * sizeof(*outFileName)); + strcpy(outFileName, inputName); + strcat(outFileName, ".counts"); + return outFileName; +} -- cgit v1.2.3