Record Detail

Compile Error

/in/ex1.c: In function 'main':
/in/ex1.c:10:11: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
     while(ch = getchar() != '\n'){
           ^~
/in/ex1.c:11:13: error: 'flag' undeclared (first use in this function); did you mean 'falg'?
         if (flag = 1){  // make a direction to record the extension and int array to 
             ^~~~
             falg
/in/ex1.c:11:13: note: each undeclared identifier is reported only once for each function it appears in
/in/ex1.c:13:13: error: statement with no effect [-Werror=unused-value]
             dir[dir_num]
             ^~~
/in/ex1.c:15:9: error: expected ';' before '}' token
         }
         ^
/in/ex1.c:9:9: error: unused variable 'num' [-Werror=unused-variable]
     int num[500];
         ^~~
/in/ex1.c:8:18: error: variable 'ext_num' set but not used [-Werror=unused-but-set-variable]
     int falg = 0,ext_num,dir_num;
                  ^~~~~~~
/in/ex1.c:8:9: error: unused variable 'falg' [-Werror=unused-variable]
     int falg = 0,ext_num,dir_num;
         ^~~~
/in/ex1.c:6:10: error: unused variable 'ext' [-Werror=unused-variable]
     char ext[20] = {0};
          ^~~
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Problem
Mid2 Ex1
Homework
Midterm Exam 2
Language
C
Submit At
2022-07-07 15:41:50
Judged At
2022-07-08 16:04:55
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes