I'm putting together a small app that reads paths entered line by line in a text file.
I know the issue with reading a variable length line using Fgets and the newline character is as old as the hills but I was wondering if anyone has a more elegant way of dealing with the newline character than my method? :
Fgets(buf,sizeof(buf),*file);
buf[strlen(buf)-1]='\0';
It works but I always think it's too messy and that there must be a better way...