I'm currently taking an online C-programming class, and one of the things that was taught to remove a '\n' from a string, was to use the lineCode:str [lenOfStr - 1] = '\0';
I get that the '-1' removes the the '\n', but was wondering why the '= '\0'' is necessary. I thought all empty segments after the string automatically filled with the null digit, so I'm curious why it doesn't in this case.