Well what you gotta do basically is to create a 2 loops: the first one will go over the characters in the string and the second one (inside the first one) will go over all the characters between A to Z and if str[i] equals to j (which holds the character between A to Z); if so, add to the new string which you created at the begging of the function, this: ((char) ((int)'A' + 32))
You also have to add another loop (not inside the second one but inside the first one) that will go over all the characters between a to z and the same condition but just when you add this to the new string, you subtract 32 instead of adding.
Code:
If the function gets 1 parameter:
char *newstr = malloc(strlen(str) + 1);
for(;;)
{
for(;;)
{
// do stuff
}
for(;;)
{
// do stuff
}
}
BTW,
The function has to get only 1 parameters although you can create another loop which will loop twice and go over the other string too (and put both of the strings in an array of char *s: char *arr[2])
Code:
If the function gets 2 parameters:
char *arr[2];
arr[0] = str1;
arr[1] = str2;
int counter = 0;
char *newstr = malloc(strlen(str) + 1);
for(;;) // loop twice so we can go over 2 strings and not only one
{
for(;;) // loop on counter
{
for(;;)
{
// do stuff
}
for(;;)
{
// do stuff
}
}
counter++; // increase counter so we can go over the second string
}
Good luck!