title: Why is my output a null?
body: <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;time.h&gt;
  
  int main(){
  
      char str [1000] = "";
      char ch     = 'M';
      char *findM;
          printf("Enter a line of text\n");
          scanf("%s", str);
              findM = strchr(str, ch);
          printf("string after %c is %s ", ch, findM);
  
      return 0;
  }
  </code></pre>
  
  <p>The input to the program is <code>"My name is Steve"</code>, and the output of this program becomes, string after M is (null) Why is this occurring?</p>