Question: I was converting a string to lowercase using transform and the compiler gives an error stating transform was not declared in the scope.

`transform(my_str.begin(), my_str.end(), my_str.begin(), ::tolower);`

Or tell me an alternative solution to solve this problem, thanks!

Answer: 
According to the [documentation for `transform`](https://en.cppreference.com/w/cpp/algorithm/transform), this is a function in the `std` namespace. You will have to include the correct header file, and qualify the function name:

```
#include <algorithm>

std::transform(my_str.begin(), my_str.end(), my_str.begin(), ::tolower);

```
If you can't use `transform` or `::tolower`, then you have to assume ASCII encoding, 
implement your own tolower and then use a `for` loop to convert the `string`.

```
#include    <iostream>
#include    <string>

char mytolower (char c) {
    constexpr int shift = 'A' - 'a';
    if (c >= 'A' && c <= 'Z') {
        c -= shift;
    }
    return c;
}

int main () {
    std::string s = "sAcVZu";
    for (char &c: s) {
        c = mytolower (c);
    }
    std::cout << s;
}

```