I have stumbled upon something that has me utterly confused.
std::reverse()
takes bidirectional iterators as arguments into the function, but when I pass pointers to the function, it seems to work fine and actually reverse the string.
void reverseFour(char* str) {
reverse(str, str + strlen(str));
}
int main {
char *str = "hello";
str += '/0';
reverseFour(str);
}
So, my question is, how is this possible? Bidirectional iterators are not pointers, right?