Job 18514

Owner
Andrei Udriste
Problem
Lumber Jack and Grammar
Source
0.35KB
Result
Compile error (Non-zero exit status: 1)

Compiler output

prog.cpp: In function 'int main()':
prog.cpp:15:35: warning: comparison is always false due to limited range of data type [-Wtype-limits]
     if(ch=='\0' || ch=='\n' || ch == EOF) break;
                                   ^
prog.cpp:16:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
     if(c == ',') printf(" ,");
             ^
prog.cpp:17:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
     else if(c != '-' && c != '.') printf("%c", c);
                  ^
prog.cpp:17:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
     else if(c != '-' && c != '.') printf("%c", c);
                              ^
prog.cpp:17:49: warning: format '%c' expects argument of type 'int', but argument 2 has type 'char*' [-Wformat=]
     else if(c != '-' && c != '.') printf("%c", c);
                                                 ^

Questions?

Sponsors Gold