title: scanf without additional arguments in C
body: <p>Is it allowed to use <code>scanf(" ")</code> without additional arguments to ignore initial whitespaces?<br>
  I'm using <code>getchar()</code> to read the chars of a word, and I want to ignore the whitespaces before the word (whitespaces after are used to check the end of the word).<br>
  The code is the following, is it correct?</p>
  
  <pre><code>char *read_word() {
      int size = 2;
      int char_count = 0;
      char *s;
      char ch;
  
      s = mem_alloc(size);
  
      scanf(" ");
  
      while ((ch = getchar()) != EOF) {
          if (char_count &gt;= size) {
              s = mem_realloc(s, size++);
          }
  
          if (ch == ' ' || ch == '\n') {
              s[char_count] = '\0';
              break;
          }
  
          s[char_count++] = ch;
      }
  
      return s;
  }
  </code></pre>