Created
November 22, 2012 11:25
-
-
Save pgrm/4130672 to your computer and use it in GitHub Desktop.
AMPP - crappy loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do { | |
ch = fgetc(in1); | |
if ( ch == EOF ) break; | |
LOOP1: if ( ch == 10 || ch == 13 ) { | |
// newline or carriage return | |
ch = fgetc(in1); | |
if ( ch == EOF ) break; | |
goto LOOP1; | |
} | |
// Bad style with 'goto', but then | |
// one need not assume there aren't 2 '\n' in a row | |
while ( isdigit(ch)|| ch==' ' ) ch=fgetc(in1); | |
// skip over position number and blanks | |
a[++i]= char2AA(ch); // preincrement and cast | |
if (i+1==N) break; // don't overflow array size | |
} while ( 1 ); /** infinite while loop */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment