title: Why does scanf skip getting string input?
body: <p>I am trying to get multiple words input and multiple lines into one array. But somewhere the code skips getting the input and skips to end the program. I have tried adding space before and after the ' %s' (or '%s ') but it won't work (maybe because it's inside a loop?). Would really appreciate anyone's help! It also starts to act weird if I enter more than two-three words :(
  My goal is to find how many times a specific letter has occurred throughout all those words and lines.</p>
  
  <pre><code>#include &lt;stdio.h&gt; //include standard library
  
  int main(){
    int lineCount, occuranceCount;
    printf("How many lines are you going to enter?");
    scanf("%d", &amp;lineCount);
  
    char input[lineCount][100], searchChar;
  
    for(int i=0; i&lt;lineCount; i++){
      printf("Please enter line #%d (100 characters of less):",i+1);
      scanf("%s", &amp;input[i]);
    }
  
    printf("What letter do you want to check the frequence in those lines? ");
    scanf("%c", &amp;searchChar);
  
    for(int j=0; j&lt;lineCount; j++){
      for(int k=0; k&lt;100; k++){
        if(input[j][k] != '\0'){
          if(input[j][k]==searchChar)
            occuranceCount++;
        }
      }
    }
  
    printf("The letter occurs for %d time", occuranceCount);
  
    return 0;
  }
  </code></pre>