valgrind
for memory leak detection
-g
flag
valgrind ./your-program
#include <string.h>
for helper functions
strcmp
to compare the strings, will return zero if the same
realloc
to make the original name string bigger
memcpy
to append the additional name to the original name/string
getchar()
function to get letters from the command line.
malloc()
and realloc()
to control the memory.
free()
at the end to free the memory.
strcmp()
function from the string.h library.