Question: I am trying to use reCAPTCHA globally by following the instructions present at <https://developers.google.com/recaptcha/docs/faq#can-i-use-recaptcha-globally> . However, it is not working for me.

I replaced all the occurrences of "https://www.google.com/recaptcha" with "https://www.recaptcha.net/recaptcha" but what I noticed is it is still referring to google.com internally.

<https://www.recaptcha.net/recaptcha/api.js> is making a call to <https://www.gstatic.com/recaptcha/releases/TPiWapjoyMdQOtxLT9_b4n2W/recaptcha__en.js> and it is internally referring to google.com host.

Looks like ReCaptcha code is broken to me. Any ideas on this?

Answer: 
"*4.8.5 supports c++11, so compile with `-std=c++11` and you're fine.*" would be *my* first sentence when handing in the assignment.

You could follow up by converting the code to C++98.

Since `decltype` doesn't exist and `auto` doesn't mean the same thing in C++98 (it exists but for a different purpose) you need to type the long, complicated types. I suggest making some aliases to some of the map's [member\_types](https://en.cppreference.com/w/cpp/container/map) to make it simpler:

```
void printMostFrequent(string fileName, ofstream& out) {
  // helper aliases
  typedef map <string, int>::const_iterator map_const_iterator;
  typedef map <string, int>::iterator       map_iterator;
  typedef map <string, int>::value_type     map_value_type;   // std::pair<const Key, T>

  // ...

```

Now replacement should be fairly straight forward.

```
decltype(count)::const_iterator most_occurring; // easy

auto itr = count.emplace(word, 0).first;        // harder

```

`map::emplace` doesn't exist in C++98 so the next best thing is [`insert`](https://en.cppreference.com/w/cpp/container/map/insert), but you can't do `insert(word, 0)`. You need to insert an element of the map's `value_type` that we made an alias for above to make it easier.

You must be able to change the value of the mapped type (the `int`) in the map through the *iterator* you get back from `insert`, so it can't be a *const\_iterator* - and we happened to make an alias for that type of *iterator* as well.
`decltype` and `auto` are C++11 features. Replace `decltype` with the desired class and replace `auto` with the desired type.

In order to catch the C++11 features yourself, compile with the option `-std=c++98`...or install the 4.8.5 version of GCC...

Here's some more info about why this is. In 4.8.5, the default version is c++98, although you can use C++11 by giving the `-std=c++11` flag. In GCC 6.3.0, the default is C++14. Since the TA is using 4.8.5, they are using C++98 by default. In order to match this, you should set your standard to `-std=c++98`. This is not the only difference between the two versions of GCC, but will hopefully be enough to ensure that your TA can run it.