Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(char argv**) {
- FILE *fp;
- char ch;
- int num;
- long length;
- fp = fopen(argv[1], "r");
- if (fp == NULL) {
- puts("cannot open this file");
- exit(1);
- }
- fseek(fp, 0, SEEK_END);
- length = ftell(fp);
- fseek(fp, (length - 1), SEEK_SET);
- do {
- ch = fgetc(fp);
- putchar(ch);
- } while (ch != EOF);
- fclose(fp);
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement