Handling CRLF, CR and LF when reading a txt file
10:15 15 Mar 2019

I have a portion of C-code as below which is complied in linux gcc environment.

In my project I have to handle ALL CRLF, CR and LF when reading a txt file created from different OS.

I'm not sure if fscanf() handles all cases automatically.

Is there any other way that can handle all cases?

while (fscanf(fp, "%d", &data) != EOF) 
{
    printf("%d\n", data);
}
c newline lf