title: Strange symbols when using printf in C
body: <p>I have a question about <code>printf</code> in C. I try to print a matrix as a string, but instead of the matrix I get many of these symbols:<br />
  <a href="https://i.stack.imgur.com/WwgrA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WwgrA.png" alt="enter image description here" /></a></p>
  <p>I have no idea what it is and found no information on internet. Can someone explain me what it is and how to avoid it?</p>
  <p>Here is my code:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  
  int main()
  {
      int mat[9][9] = {{1, 2, 3, 4, 5, 6, 7, 8, 9},
                       {7, 8, 9, 1, 2, 3, 4, 5, 6},
                       {4, 5, 6, 7, 8, 9, 1, 2, 3},
                       {9, 1, 2, 3, 4, 5, 6, 7, 8},
                       {6, 7, 8, 9, 1, 2, 3, 4, 5},
                       {3, 4, 5, 6, 7, 8, 9, 1, 2},
                       {8, 9, 1, 2, 3, 4, 5, 6, 7},
                       {5, 6, 7, 8, 9, 1, 2, 3, 4},
                       {2, 3, 4, 5, 6, 7, 8, 9, 1}};
  
      char matrix[81];
  
      for (int i = 0; i &lt; 9; i++)
      {
          for (int j = 0; j &lt; 9; j++)
          {
              matrix[i * 9 + j] = (char)mat[i][j];
          }
      }
  
      for (int a = 0; a &lt; 81; a++)
      {
          printf(&quot;%c\n&quot;, matrix[a]);
      }
      return 0;
  }
  </code></pre>