title: how to get rid off garbage in array of chars?
body: <p>I'm writing a C program but I keep having problems with my array of chars. I keep getting garbage when I print it using prinf. here is an example of what I get when I print it:</p>
  
  <p>char at t.symbol is <strong>Aôÿ¿</strong> <br/>
  char at tabl[0].symbol is A <br/>
  char at tabl[1].symbol is a <br/>
  char at tabl[2].symbol is a <br/>
  char at tabl[3].symbol is d <br/>
  char at tabl[4].symbol is e <br/>
  char at tabl[5].symbol is f <br/>
  char at tabl[6].symbol is g <br/>
  char at tabl[7].symbol is h <br/>
  char at tabl[8].symbol is i <br/>
  char at tabl[9].symbol is x <br/>
  char at t[0].symbol is <strong>a0AÃ</strong> <br/>
  char at t[1].symbol is <strong>b)@Ã4</strong> <br/>
  char at t[2].symbol is <strong>ckU*</strong> <br/>
  char at t[3].symbol is <strong>Aôÿ¿</strong> <br/>
  char at t[4].symbol is <strong>gØ</strong> <br/></p>
  
  <p>could someone tell me how to get rid off the garbage in the array of chars?</p>
  
  <p>here is my code</p>
  
  <pre><code>#define MAX 100
  #ifndef SYMBSIZE
   #define SYMBSIZE 1
  #endif    
  
  typedef struct tableme 
  {
      char symbol[SYMBSIZE];
      int value;
      int casenmbr;
      int otherinfo;
  }tabletype;
  int main(int argc, char **argv)
  {
      tabletype t[MAX];
      t[3].symbol[0] = 'A';
  
      t[0].value=1;  
      t[0].casenmbr = 7;
      t[0].otherinfo = 682;
  
      tabletype tabl[MAX];
      tabl[0].value = 1;
      tabl[0].symbol[0] = 'A';
      tabl[1].value = 11;
      tabl[1].symbol[0]= 'a';
      tabl[2].value = 12;
      tabl[2].symbol[0] = 'a';
      tabl[3].value = 13;
      tabl[3].symbol[0] = 'd';
      tabl[4].value = 14;
      tabl[4].symbol[0] = 'e';
      tabl[5].value = 15;
      tabl[5].symbol[0] = 'f';
      tabl[6].value = 16;  
      tabl[6].symbol[0] = 'g';
      tabl[7].value = 17;
      tabl[7].symbol[0] = 'h';
      tabl[8].symbol[0] = 'i';
      tabl[9].symbol[0] = 'x';
      t[1].symbol[0] = 'b';
      t[0].symbol[0]= 'a';
      t[2].symbol[0]= 'c';
  
      t[4].symbol[0]= 'g';
      printf("char at t.symbol is %s \n", t[3].symbol);
  
      for( x=0;x&lt;10;x++)
      {
              printf("char at tabl[%d].symbol is %s \n",x, tabl[x].symbol);
      }
      int j;
      for(j = 0; j&lt;5;j++)  
      {
              printf("char at t[%d].symbol is %s \n",j, t[j].symbol);
      }
      return 0;
  }
  </code></pre>