Jones
2006.06.04, 12:08 PM
Ok, I am SO sick of this error. C++ just won't let me compare char's to actual text. In recent code I've had to actually define certain letters I wanted to check for in arrays.
char hello[] = {"h", "w", "w"};
What's wrong with that? Nothing as far as I can tell! But I get 3 errors:
/Users/gareth/desktop/sizeOf Test/main.cpp:5: error: invalid conversion from 'const char*' to 'char'
/Users/gareth/desktop/sizeOf Test/main.cpp:5: error: invalid conversion from 'const char*' to 'char'
/Users/gareth/desktop/sizeOf Test/main.cpp:5: error: invalid conversion from 'const char*' to 'char'
C never did this, why is C++?
char hello[] = {"h", "w", "w"};
What's wrong with that? Nothing as far as I can tell! But I get 3 errors:
/Users/gareth/desktop/sizeOf Test/main.cpp:5: error: invalid conversion from 'const char*' to 'char'
/Users/gareth/desktop/sizeOf Test/main.cpp:5: error: invalid conversion from 'const char*' to 'char'
/Users/gareth/desktop/sizeOf Test/main.cpp:5: error: invalid conversion from 'const char*' to 'char'
C never did this, why is C++?