title: Program in c crashes
body: <p>My code seems to crash everytime i run it, i want to make a program that finds a capital letter in a sentence (str[max]) and it prints out how many times it finds it </p>
  
  <p>i get a warning from the build log (warning: 'c' may be used uninitialized in this function)  (very entry level programmer here !!) </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include "genlib.h"
  #include "simpio.h"
  #include "ctype.h"
  
  
  #define max 26
  
  void checktimes(char str[],char temp);
  
  int main()
  {
  char str[max], temp;
  printf("Type a sentence with 25 characters max :");
  gets(str);
  
  int i;
  for(i=0;i&lt;=max;i++)
  {
  temp = str[i];
   if(isupper(temp))
      checktimes(str,temp);
  }
   return 0;
  }
  
  void checktimes(char str[],char temp)
  {
  int j,i;
  char c;
  for(j=0; j&lt;=max ; j++)
  {
      str[i] = c;
      if(c == temp)
          i++;
  }
  printf("%c --&gt; %d",temp,i);
  </code></pre>
  
  <p>}</p>