Hello,
Could you explain me why the first approach in the code above works and the second one fails?
#include <cstring>
#include <algorithm>
//char a[] = {'a', 'c', 'b', 'a', 'c', 'b', '\0'}; // Works
char* a = "acbacb"; // Fails
sort(a, a+strlen(a));