title: C: warning: excess elements in array initializer; near initialization for ‘xxx' ; expects ‘char *’, but has type ‘int’
body: <p>I've some warnings while trying to compile program in C language:</p>
  
  <blockquote>
  <pre><code>13:20: warning: excess elements in array initializer [enabled by default]
  
  13:20: warning: (near initialization for ‘litera’) [enabled by default]
  
  22:18: warning: excess elements in array initializer [enabled by default]
  
  22:18: warning: (near initialization for ‘liczba’) [enabled by default]
  
  43:1: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat]
  
  45:2: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat]
  
  55:2: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat]
  </code></pre>
  </blockquote>
  
  <p>The source is:</p>
  
  <pre><code>char litera[63] = {'E', 'G', 'H', 'F', 'E', 'G', 'H', 'F',
                     'D', 'B', 'A', 'C', 'D', 'B', 'A', 'C', 
                     'B', 'A', 'C', 'D', 'C', 'A', 'B', 'D', 
                     'F', 'H', 'G', 'E', 'F', 'H', 'G', 'E', 
                     'C', 'D', 'B', 'A', 'B', 'A', 'C', 'D', 
                     'F', 'E', 'G', 'H', 'G', 'H', 'F', 'G', 
                     'H', 'F', 'E', 'F', 'H', 'G', 'E', 'C',
      /*line13:*/    'A', 'B', 'D', 'C', 'A', 'B', 'D', 'E'};
  
  int liczba[63] ={'8', '7', '5', '6', '4', '3', '1', '2', 
                   '1', '2', '4', '3', '5', '6', '8', '7', 
                   '5', '7', '8', '6', '4', '3', '1', '2', 
                   '1', '2', '4', '3', '5', '6', '8', '7', 
                   '6', '8', '7', '5', '3', '1', '2', '4', 
                   '3', '1', '2', '4', '6', '8', '7', '5', 
                   '7', '8', '6', '4', '3', '1', '2', '1', 
      /*line22*/   '2', '4', '3', '5', '6', '8', '7', '5'};
  
  
  int i=0, x=0, n;
  char a;
  int b=0;
  printf("Podaj literę z pola startowego skoczka(duże litery)\n");
  scanf("%s", &amp;a);
  printf("Podaj liczbę z pola startowego skoczka \n");
  scanf("%d", &amp;b);
  
  if (b&lt;=0 || b&gt;8){
      printf("Zła pozycja skoczka\n");
      return 0;
      }
  
  while (litera[i] != a || liczba[i] != b){
      ++i;
      }
  n=i;
  
  /*line43*/ printf("Trasa skoczka od punktu %s %d to:\n", a, b); 
  while (i&lt;=64){
  /*line45*/ printf("%s%d ", litera[i], liczba[i]);
      ++i;
  
      ++x;
      x=x%8;
      if(x==0)
          printf("/n");
      }
  i=0;
  while (i&lt;n){
  /*line55*/ printf("%s%d ", litera[i], liczba[i]);
  
      ++i;
  
      ++x;
      x=x%8;
      if(x==0)
          printf("/n");
      }
  </code></pre>
  
  <p>also I have "core dumped" after <code>scanf("%d", &amp;b);</code>, but <code>int b=0;</code> doesn't make a problem...</p>