title: Trying to put some digits into a char array
body: <p>I'm trying to create a char array made of some letters and numbers (the function was way more complex initially but i kept simplifying it to figure out why it doesn't work properly). So i have a char array in which i put 2 chars, and try to add some numbers to it.
  For a reason i can't figure out, the numbers do not get added to the array. It might be really stupid but I'm new to C so here's the simplified code. Any help is much appreciated, thanks!</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  char some_string[20];
  
  char *make_str() {
    some_string[0] = 'a';
    some_string[1] = 'x';
    int random = 0;
    int rand_copy = 0;
    random = (rand());
    rand_copy = random;
    int count = 2;
    while ( rand_copy &gt; 0 ) {
      rand_copy = rand_copy / 10;
      ++count;
    }
    int i=2;
    for (i=2; i&lt;count; i++) {
      some_string[i] = random%10;
      random = random/10;
    }
    return (some_string);
  }    
  
  int main(int argc, const char *argv[]) {
    printf("the string is: %s\n",make_str());
    return 0;
  }
  </code></pre>