Record Detail

Compile Error

/in/fileReverse.c: In function 'fileReverse':
/in/fileReverse.c:21:16: error: passing argument 1 of 'ftell' from incompatible pointer type [-Werror=incompatible-pointer-types]
     last=ftell(filename);
                ^~~~~~~~
In file included from /in/fileReverse.c:1:0:
/usr/include/stdio.h:689:17: note: expected 'FILE * {aka struct _IO_FILE *}' but argument is of type 'char *'
 extern long int ftell (FILE *__stream) __wur;
                 ^~~~~
/in/fileReverse.c:23:15: error: passing argument 1 of 'fseek' from incompatible pointer type [-Werror=incompatible-pointer-types]
         fseek(filename, -count, SEEK_END);
               ^~~~~~~~
In file included from /in/fileReverse.c:1:0:
/usr/include/stdio.h:684:12: note: expected 'FILE * {aka struct _IO_FILE *}' but argument is of type 'char *'
 extern int fseek (FILE *__stream, long int __off, int __whence);
            ^~~~~
/in/fileReverse.c:24:19: error: passing argument 1 of '_IO_getc' from incompatible pointer type [-Werror=incompatible-pointer-types]
         ch = getc(filename);
                   ^
In file included from /usr/include/stdio.h:41:0,
                 from /in/fileReverse.c:1:
/usr/include/x86_64-linux-gnu/bits/libio.h:433:12: note: expected '_IO_FILE * {aka struct _IO_FILE *}' but argument is of type 'char *'
 extern int _IO_getc (_IO_FILE *__fp);
            ^~~~~~~~
/in/fileReverse.c:24:14: error: conversion to 'char' from 'int' may alter its value [-Werror=conversion]
         ch = getc(filename);
              ^~~~
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Midterm Exam 2
Language
C
Submit At
2022-07-07 15:43:53
Judged At
2022-07-08 16:06:01
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes