title: How to list all strings of length 12 in C++?
body: <p>I'm a novice programmer studying my own. I tried to make a program that lists all strings of length 12 such as its characters are from a-z. However, there seems to be a bug I could find. It outputs for example <code>The word is ).</code> Could anyone tell me what I'm doing wrong, and is there some easier way to do the program?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  int main(int argc, char *argv[])
  {
      using namespace std;
      string l ("qwertyuiopasdfghjklzxcvbnm");
      string test ("");
      for(int i1 = 0;i1 &lt; 26;++i1)
      for(int i2 = 0;i2 &lt; 26;++i2)
      for(int i3 = 0;i3 &lt; 26;++i3)
      for(int i4 = 0;i4 &lt; 26;++i4)
      for(int i5 = 0;i5 &lt; 26;++i5)
      for(int i6 = 0;i6 &lt; 26;++i6)
      for(int i7 = 0;i7 &lt; 26;++i7)
      for(int i8 = 0;i8 &lt; 26;++i8)
      for(int i9 = 0;i9 &lt; 26;++i9)
      for(int i10 = 0;i10 &lt; 26;++i10)
      for(int i11 = 0;i11 &lt; 26;++i11)
      for(int i12 = 0;i12 &lt; 26;++i12)  {
          test = l[i1]+l[i2]+l[i3]+l[i4]+l[i5]+l[i6]+l[i7]+l[i8]+l[i9]+l[i10]+l[i11]+l[i12];
          cout &lt;&lt; "The word is " &lt;&lt; test &lt;&lt; "." &lt;&lt; endl;
          test = "";
      }
      return 0;
  }
  </code></pre>