www.digitalmars.com         C & C++   DMDScript  

c++.dos.16-bits - Re: fopen requires const char instead of char in other compilers

reply "Lars Hansen" <lars.o.hansen gmx.de> writes:
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
parent Heinz Saathoff <hsaat bre.ipnet.de> writes:
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