Hey guys i got an assignment that i cant seem to solve. I get a char* string and i need to make all upper case letters (everything is in ASCII) to lower case using bit operations. I'm adding my code but it keeps crashing.
#include <iostream>
#include <cstring>
using namespace std;
void convertToLower(char* string)
{
for (unsigned int i = 0; i < strlen(string); i++)
{
if (string[i] >= 65 && string[i] <= 90)
{
string[i] |= 32;
}
}
cout << string << endl;
}
int main()
{
convertToLower("Hello");
return 0;
}