The unary operator method toupper was called but what is the scope resolution operator(::) doing as the function is not in the provided code. Also, is the parameter to toupper implicit so parentheses are not needed as in "toupper()".
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
string hello = "hello";
cout << hello << endl;
cout << "Begin: " << *hello.begin() << endl;
cout << "End: " << *(hello.end()-1) << endl;
transform(hello.begin() , hello.end(), hello.begin() +1 , ::toupper);
cout << hello;
}
Bonus question- The hello variable after transform call is "hHHHH". Why is hello variable not "hHELL"?