I am using fgets to read lines of a file. I am then using if statements based on the location of the new line character to decide which sscanf to use. I have been getting a lot of windows files which usually use carriage returns. Most of the timeit "seems" to work ok with carriage returns but other time it goes crazy on me. I was wondering how I should handle this. Should I add the ascii value of carriage returns to my if statements? Or is there a better way to handle this?
if ( line[10] == 10 )
{
//sscanf
}
if ( line[20] == 10 )
{
//sscanf
}
if ( line[30] == 10 )
{
//sscanf
}