"invalid conversion from `const char' to `const char*"Code:#include <iostream> #include <cstdlib> #include <cstring> using namespace std; char output[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; char reverseorder(const char *input) { for(int a = strlen(input); a>=0; a--) { strcat(output, input[a]); //what the hell, man? input--; //invalid } //conversion from `const char' to `const char*' return *output; } int main() { char input[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; cout << "Put in something of less than /n 20 characters, chap" << endl; cin >> input; cout << reverseorder(input) << endl; return 0; }
What's up with that?



LinkBack URL
About LinkBacks


