February 17, 2003 Re: fopen requires const char instead of char in other compilers | ||||
---|---|---|---|---|
| ||||
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; |
February 17, 2003 Re: fopen requires const char instead of char in other compilers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Lars Hansen | 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