19.01.2010, 16:35
pawn Код:
new lines;
while(fread(string, FILE))
{
lines++;
}
printf("File has %d lines", lines);
new max_lines = lines;
lines = 0;
while(lines < max_lines - 10)
{
fread(string, FILE); //moving the pointer a line down until its on the 10th line from the back
lines++;
}
while(max_lines >= lines)
{
fread(string, FILE); //reading the last 10 lines
printf("Reading line %d", lines);
lines++;
}