hi all, to the point, i wrote this out, but for some reason it wont work... i run xp with msvc and for some reason it isnt accepting my ' ' declaration.
the purpose of this program is to convert every other word to capitol letters.
let me show you
Code:#include <iostream> using std::cout; using std::endl; #include <cctype> void convertToUppercase( char * ); int main() { char string[] = "why is msvc++ gay when it comes to spaces?"; cout << "The string before conversion is:\n\n " << string; convertToUppercase( string ); cout << "\nThe string after conversion is:\n\n " << string << endl; return 0; } void convertToUppercase( char *sPtr ) { while ( *sPtr != '\0' ) { sPtr++; while (*sPtr != ' '){ // it doesnt to like the space. if ( islower( *sPtr ) ) *sPtr = toupper( *sPtr ); ++sPtr; } } }
now my code crashes when i run it, but compiles with no errors at all........