title: Adding a number into a string in C
body: <p>I have the following code snippets:</p>
  <pre><code>student_t students[10];
  char *name = &quot;Student&quot;;
  </code></pre>
  <p>and this one</p>
  <pre><code>for (int i = 0; i &lt; STUDENT_COUNT; i++) {
      students[i].id = i;
      students[i].note = 1.0 + (i%4);
      strcpy(students[i].name, name);
      students[i].name[7] = (char) i + '0';  
      students[i].name[8] = '\0';           
  }
  </code></pre>
  <p>I dont understand this part:</p>
  <pre><code>    students[i].name[7] = (char) i + '0';  
      students[i].name[8] = '\0';  
  </code></pre>
  <p>What is happening here?</p>