title: Can't pass pointers to scanf("%s",ptr);
body: <p>So I commented out the scanf part (and just initialized it with my own string), why does it crash if I use scanf? I believe the actual arguments I've put in scanf(); are correct.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  int strendmilan(char *s,char *t)
  {
      int scntr = 0,tcntr = 0;
      while(*(s+(scntr++)) != '\0')
          ;
      --scntr;
      while(*(t+(tcntr++)) != '\0')
          ;
      --tcntr;
      while(tcntr &gt;= 0)
          if(*(s+scntr--) == *(t+tcntr--))
              ;
          else
              return 0;
      return 1;
  }
  int main()
  {
      char *s,*t; 
      /*
      scanf("%s",s);
      scanf("%s",t);
      */
      s = "HAHAHACOOL";
      t = "COOL";
      if(strendmilan(s,t) == 0)
          printf("NOT");
      else
          printf("YES");
      getch();
  }
  </code></pre>