title: scanf doesn't input space as a character
body: <p>The program below is supposed to print out all the characters of a line from a file between two entered characters. It works fine for all test cases except for the one where one of the explicitly entered characters is a space.</p>
  
  <p>ex.</p>
  
  <p>Input:</p>
  
  <p>12345 Maja Majovska: 54</p>
  
  <p>15145 Aco Acoski: 95</p>
  
  <p>14785 Martin Martinoski: 87</p>
  
  <p>#</p>
  
  <p>: //Under the hashtag is the space</p>
  
  <p>Correct output:</p>
  
  <hr>
  
  <p>Maja Majovska</p>
  
  <p>Aco Acoski</p>
  
  <p>Martin Martinoski</p>
  
  <hr>
  
  <p>My output:</p>
  
  <p>54</p>
  
  <p>15145 Aco Acoski 95</p>
  
  <p>14785 Martin Martinoski 87</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;string.h&gt;
  
  void wtf() {
      FILE *f = fopen("podatoci.txt", "w");
      char c;
      while((c = getchar()) != '#') {
          fputc(c, f);
      }
      fclose(f);
  }
  
  int main()
  {
      wtf();
      getchar();
      char z1, z2, c;
      FILE *f;
      f=fopen("podatoci.txt", "r");
      int flag=0;
      scanf(" %c %c", &amp;z1, &amp;z2);
      while((c=fgetc(f))!=EOF){
          if(c==z1){
              flag=1;
              continue;
          }
          if(c==z2){
              flag=0;
              printf("\n");
          }
          if(flag)
              printf("%c", c);
      }
      fclose(f);
      return 0;
  }
  </code></pre>
  
  <p>Can someone point out simply what am i doing wrong? I'm new to working with files.</p>