Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 Point out the error/warning in the program? #include<stdio.h> int main() { unsigned char ch; FILE fp; fp=fopen("trial", "r"); while((ch = getc(fp))!=EOF) printf("%c", ch); fclose(fp); return 0; } ?->(Show Answer!)
1. Point out the error/warning in the program? #include<stdio.h> int main() { unsigned char ch; FILE fp; fp=fopen("trial", "r"); while((ch = getc(fp))!=EOF) printf("%c", ch); fclose(fp); return 0; }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.01 pm
Here, EOF is -1. As 'ch' is declared as unsigned char it cannot deal with any negative value.