title: Fast input string in single line without array in C/C++
body: <p>I have to input string once in single line and then iterate char by char in the fastest posible way.
  I tried gets, fgets, fread, scanf but these functions requaire to use array like there:</p>
  
  <pre><code>char* array = new char[100000];
  fgets(array,100000,stdin);
  //gets(array);
  //scanf("%[^\n]s", array);
  </code></pre>
  
  <p>Mayby there is faster way to read line for e.g without array ?
  I need to use each char only once.
  I tried to use fgetc but it doesn't work.</p>
  
  <pre><code>char c;
  while((c=fgetc(stdin))!='\n'){
      if(c==' ') c=fgetc(stdin); // if char is a space go to next char from input
         //code
  }
  </code></pre>