for example I have a string data with the following contents
std :: string words {"armando dippet"};
if using
words.begin () / end ()
then it works,
but if
std :: string words [] {"gandalf", '"harry", "malfoy", "ron"}
using
std::sort(words.begin () / end ())
does not work, but must be changed to
std :: sort (std :: begin (words), std :: end (words))
or
std :: sort (words, words + sizeof ( words) / sizeof (words [0]))
in order to run, then I switched to dynamic strings
std :: string * words {new std :: string [2] {"hermione", "aziz"}}
using
std::sort(std :: begin (words) / end (words))
didn't work, using
std::sort(words-> begin () words -> end ())
is successful but the result is not suitable, using
std :: sort (words, words + sizeof (words) / sizeof (words [0]))
is successful
To be honest, I'm confused about the use of sort