February 17, 2003 Re: fopen requires const char instead of char in other compilers | ||||
---|---|---|---|---|
| ||||
Thank you very much! that cleared a problem I had for me! (tj, sometimes (when not using it for a long time) it's directly in front of you and you don't recognize it (I didn't get the code to work as expected actually): I need to dereference argv[1]! of course...) Lars "Heinz Saathoff" <hsaat@bre.ipnet.de> schrieb im Newsbeitrag news:MPG.18bab22821d8c3d69896b5@news.digitalmars.com... > 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) > Compiler messages are somtimes confusing :-) > > - Heinz > |
Copyright © 1999-2021 by the D Language Foundation