Reputation: 4845
I am trying to sort char array like this:
#include<algorithm> ... char x[] = "coast"; sort(x, x+5); std::cout<<x;
But it displays garbage. Integer arrays are sorted properly however.
Upvotes: 1
Views: 937
Reputation: 47612
Works fine over here
[~]> clang++ test.cpp [~]> ./a.out acost
Upvotes: 3