Question: During a recent interview one of my friends was asked a question to reverse a string using only a single line of code.
The string is already stored in a `char*` variable.

I tried using recursion, but it never reduced to a single line of code.

Could anyone help me with this?

Answer: 
```
char str[] = "test";

std::reverse(str, str + std::strlen(str));

```
It requires an ugly construct involving a while loop with character pointer arithmetic and both post-increment and post-decrement operators. Never, ever use such hideous code except in obfuscation contests. (No, not even in interviews. If they ask you such useless trivia, chances are they are equally clueless about other things.)