I'm trying to strcat char *. However, I've noticed an issue.
struct d* up //parent
char *path //path to d
char *name //path + breadth = name
printf("name: %s\n", breadth_p->name);
so say I pass the cur_parent name and path as root and b as 3. the following prints out
I'm assuming that I didn't free the breadth_p correctly so it's concatenating the previous names.
the results I'm expecting is
Can anyone help me figure out why this is happening?