It won't. toupper does not change the parameter passed to it. It returns the uppercase as the return value.
So in your uppersize function you have upper(ch[i]); which will have no effect on ch[i] as the code stands.
if you want to you can leave that line as it is and change the upper function to ch = toupper(ch); //you can forget about the return and make it a void function now
because ch was passed by reference.
inlinevoid upper(char & ch)
{
switch(ch)
{
//all those we don't want touched in any way
case a_accent:
case e_accent:
case i_accent:
case o_accent:
case u_accent:
case sset:
case a_umlaut:
case o_umlaut:
case u_umlaut:
break;
//all others - change case if needed
default:
ch = toupper(ch);
break;
}
}
for that matter I can't seem to manually modify anything.
this code is causing me to crash:
1 2 3 4 5 6 7 8 9
constchar yada[33] = { "yadayadayada"};
int main()
{
char * copy;
copy = new (nothrow) char[33];
copy = yada;
upperize(copy); //I can't do this unless upperize doesn't do nothing to copy.
//I can't even do the following:
copy[0] = "A";
This doesn't copy what's in yada to the memory pointed to by copy. It makes copy point to yada (causing a memory leak, too). That's why you need functions such as strcpy().