title: comparing strings with strcmp-crash
body: <p>I am experimenting with pointers and strings. In the following code, everything is tested (you can compile and run yourselves), but I keep crashing when I am trying to use
  strcmp. The code runs without warnings in codeblocks. Can you please point out my mistake that makes the program crash?? </p>
  
  <pre><code>    #include&lt;stdio.h&gt;
      #include&lt;stdlib.h&gt;
      #include&lt;string.h&gt;
  
      int main() 
      {
          int choice,x=7,k,q,cmp,j=0,i=0,N;
          char v[5],str[80],c[5];
          char *B[11][2]=
          {"-----","0",
           ".----","1",
           "..---","2",
           "...--","3",
           "....-","4",
           ".....","5",
           "-....","6",
           "--...","7",
           "---..","8",
           "----.","9",
           NULL,NULL};
  
           printf("Give a stream");
           if(gets(str)) printf("%s\n",str);
           fflush(stdin);
           i=0;
           while(str[i])
           {
               q=0;
               j=i+1;
               while(q%5!=0)
               {
                   v[j]=str[j];
                   puts(v);
                   j++;
                   q++;
               }
               printf("Hello");
               for(k=0; k&lt;11; k++)
               {
                   strcpy(c,B[k][0]);
                   printf("%s",c);
                   x=strcmp(v,c);
                   //Problem:
                   printf("%d",c);
                   if(x==0) printf("hi");
               }
               i=i+1;
               j++;
          }
      }
  </code></pre>