title: C - Add elements of a 2D char Array
body: <p>I am trying to add the rows and columns of a 2D char array. So that they form a word. I know how to add the elements of a 2D int array and tried to implement a similar solution here. However it does not work.</p>
  
  <pre><code>Example input:
  a  b  c  d
  e  f  g  h
  i  j  k  l
  
  Example Output:
  Row 1 word = abcd
  Row 2 word = efgh
  Row 3 word = ijkl
  </code></pre>
  
  <p>Here is the code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      unsigned int size;
      char wordR;
  
      printf("Enter size:\n");
      scanf("%d",&amp;size);
  
      char word[size][size];
  
      //Entering the matrix
      for (int k = 0; k &lt; (size); ++k){
          for (int j = 0; j &lt; (size); ++j){
              printf("Enter letter: ");
              scanf(" %c",&amp;word[k][j]);
          }
      }
  
      for (int k = 0; k &lt; size; ++k){
          for(int j = 0; j &lt; size; ++j){
              printf(" %c",word[k][j]);
          }
          printf("\n");
      }
  
      //Adding row elements
      for(k = 0; k &lt; size; ++k){
          for(p = 0; p &lt; size; ++p){
              wordR += size[k][p];
          }
          printf("Word of the %i row is = %c\n",k,wordR);
      }
  }
  </code></pre>