Nice code, Uraldor but...
Quote:
int index = strlen(input);
char first = index[0];
(...)
That should be:
char first = input[0];
instead of:
char first = index[0];
right?
nothing wrong with your function
The problem is that "string" is passed to the function convert();
change this:
Code:
int main()
{
char strTest[] = "string";
cout <<"\nBefore: " << strTest << endl;
convert(strTest);
cout <<"\nAfter: " << strTest << endl;
return 0;
}
Since convert() changes the string, you cannot pass a constant like "annoying string" ;)