title: Generating 10 random characters
body: <p>Hello I'm writing a program that would generate 10 random characters in order to form a word (it's for a game).</p>
  
  <p>so here's my function: </p>
  
  <pre><code>void GenerateTen(int number)
  {
      int i; 
      char abc[30]="abcdefghijklmnopqrstuvwxyz";
      char newabc[8];
  
  
      for (i = 0; i &lt; number; ++i) {
          newabc[i] = abc[rand() % (sizeof(abc) - 1)];
          printf("%c ", newabc[i]);
      }
  
      newabc[number] = 0;
  
  }
  </code></pre>
  
  <p>the number variable contains 10 and the output is supposed to simply print these 10 characters in the array. There's no error by the compiler however, the program generates the same set of characters. Thank you for your help! :-)</p>