Record Detail

Compile Error

/in/fileReverse.c: In function 'reverseFile':
/in/fileReverse.c:10:7: error: multi-character character constant [-Werror=multichar]
 scanf('%s', name);
       ^~~~
/in/fileReverse.c:10:7: error: passing argument 1 of 'scanf' makes pointer from integer without a cast [-Werror=int-conversion]
In file included from /usr/include/features.h:424:0,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from /in/fileReverse.c:1:
/usr/include/stdio.h:398:12: note: expected 'const char * restrict' but argument is of type 'int'
 extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
            ^
/in/fileReverse.c:16:5: error: conversion to 'int' from 'size_t {aka long unsigned int}' may alter its value [-Werror=conversion]
 a = strlen(A)-1;
     ^~~~~~
/in/fileReverse.c:9:17: error: unused variable 'B' [-Werror=unused-variable]
     char A[100],B[100];
                 ^
/in/fileReverse.c:10:1: error: 'name' is used uninitialized in this function [-Werror=uninitialized]
 scanf('%s', name);
 ^~~~~~~~~~~~~~~~~
/in/fileReverse.c:13:2: error: 'j' is used uninitialized in this function [-Werror=uninitialized]
 j=j+1;
 ~^~~~
cc1: all warnings being treated as errors

Information

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