title: How do you generate random strings in C++?
body: <p>I am looking for methods to generate random strings in C++.Here is my code:</p>
  
  <pre><code>string randomStrGen(int length) {
      static string charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
      string result;
      result.resize(length);
  
      srand(time(NULL));
      for (int i = 0; i &lt; length; i++)
          result[i] = charset[rand() % charset.length()];
  
      return result;
  }
  </code></pre>
  
  <p>But the <code>seed(time(NULL))</code> is not random enough.Are there any other better way to generate random strings in C++?</p>