title: How do I stop reading from stdin console in C
body: <p>I am new in C programming. While I was trying to code, I came across this problem. Sorry, if the solution is obvious and I posted it here.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main(){
  int T = 2;
      while(T--){
  
          c = getc(stdin);
          while( (c != '\n') &amp;&amp; (c != EOF)){
             // do some work
          c = getc(stdin);    
         }
      }
  return 0;
  }
  </code></pre>
  
  <p>what I want is like if I have multiple string inputs in multiple lines, e.g.,</p>
  
  <blockquote>
    <p>Hithere</p>
    
    <p>howareyou</p>
    
    <p>Iamgood</p>
  </blockquote>
  
  <p>And then, if after reading characters "<strong>hith</strong>", the while loop is broken then the next character to be read by <strong>fgetc(stdin)</strong> should be from the second line(<strong>howareyou</strong>) NOT the characters from "<strong>Hithere</strong>".</p>
  
  <blockquote>
    <p>Actually, I will be given 3 input strings in 3 different lines. And I
    have to check the strings individually for some special character. And
    if the character is found then I will print that it is found and
    immediately stop checking any further characters in that string.
    Similarly, check for the next string, then next string and so on.</p>
  </blockquote>
  
  <p>Many many thanks in advance. Please help me.</p>