So, here are two functions that do almost the same thing.
What would you name each of them if you included both in your project?
void strToLower1(char* str)
{
int len = strlen(str);
int i;
for (i=0; i<len; i++)
str[i] = tolower(str[i]);
}
char* strToLower2(const char* inputStr)
{
char* str = strdup(inputStr);
strToLower1(str);
return str;
}
EDIT: I modified the above example for correct code (sheesh)
source
share