c++.dos.16-bits - Re: fopen requires const char instead of char in other compilers
- "Lars Hansen" <lars.o.hansen gmx.de> Feb 16 2003
- Heinz Saathoff <hsaat bre.ipnet.de> Feb 16 2003
of course ... (actually I did that correctly in my original file, but the char conversion error occured at int main(int argc, char* argv[]){ int i; char b[4096]; ... if(b[i]!=argv[1]) ... ^ I seem not to have watched the compiler output concentratedly enough) thanks! "Walter" <walter digitalmars.com> schrieb im Newsbeitrag news:b2orci$23m4$3 digitaldaemon.com...Replace: FILE f; with: FILE *f;
Feb 16 2003
Lars Hansen schrieb...int main(int argc, char* argv[]){ int i; char b[4096]; ... if(b[i]!=argv[1]) ...
| +----- type char* +----------- type char You try to compare a char with a char* which is type incompatible. BTW, be carefull when comparing pointers. In the above case a string compare would be better: if(strcmp(a, argv[1])==0) ...I seem not to have watched the compiler output concentratedly enough)
- Heinz
Feb 16 2003