I'm trying to write some code that reads a file and ignores the line breaks (\n), so far I have:
c = fgetc(fp);
for(int loop = 0; c != EOF; loop++)
{
if((c != '\n') && (c != '\\'))
{
buffer[loop] = c;
}
c = fgetc(fp);
}
but its just not seeming to ignore the '\n' bits (not sure about the '\')
And sorry for the layout of the code, the site doesn't appear to like my version of Opera :(
Edit: Thanks guys, I've beed coding for about 6 hours straight and completely overlooked the incrementing, which is why I thought the \n remained still.
I also didn't know about the \r, uning Linux but trying to make cross platform so this is helpful.