C PROGRAMMING: Storing and classifying strings into an array from a text file
<p>Basically what I'm trying to do is read differential equations from a text file, then classifying them by the apostrophes (' is first order) ('' is second order) and then storing each equation into an array which I can then print if they are first or 2nd order. It says I have no errors but when I run it, my compiler crashes. what did I do wrong?  </p>

<pre><code>#include &lt;stdio.h&gt;
main()
{
    FILE *fin;
    int i;
    char line[300];
    int value = 0;
    fin = fopen("DIFFERNTIAL_EQNS.txt", "r");
    while(fgets(line, sizeof line, fin) != EOF)
    {
        for (i = 0; i &lt; 300; i++)
        if (line[i] == ('\''))
        {
            if (line[i++] == ('\''))
            {
                value = 2;
            }
            value = 1;
        }
    }

    if (value == 1)
        printf("this is 1st order\n");
    else
        printf("this is 2nd order\n");

    fclose(fin);
}
</code></pre>