title: C++ next_permutation function
body: <p>Im trying to write a program that will ask you to enter a four letter word. Then you're program will display all the possible four letter combinations based on the given word. Example, you entered the word TEST. Then you're program will display the following :
  TSTE TTES etc.
  based on my research and a little bit of googling i created this:</p>
  
  <pre><code>using namespace std;
  int main()
  std::string s = "";
  std::sort(s.begin(), s.end());
  do {
      std::cout &lt;&lt; "Please Enter any Letter" &lt;&lt; '\n';
      std::cin &gt;&gt; s;
      std::cout &lt;&lt; " The Permutation is " &lt;&lt; s &lt;&lt;'\n' &lt;&lt; endl;
  } while(std::next_permutation(s.begin(), s.end
  }
  </code></pre>
  
  <p>so when i try to enter a four letter word its just display the letter and permutation doesnt happen. What am i doing wrong here?
  PS Im still a beginner and a student learning C++ so please explain it clearly TY :)</p>