title: fatal error C1010 - "stdafx.h" in Visual Studio how can this be corrected?
body: <p>I compile the following code but I get a compile error in Visual Studio that I cannot understand.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
      int matchCount, findResult;
      long childPID;
      string userInput = "blank";
  
      // string to be searched through
      string longString = "The PPSh-41 is a Soviet submachine gun designed by Georgi Shpagin as an inexpensive, simplified alternative to the PPD-40.";
  
      while (userInput.compare("!wq"));
      {
          // reset variables for reuse
          matchCount = 0;
          findResult = -1;
  
          cout &lt;&lt; "Please enter a word/s to search for (!wq to exit): "; // prompts user for string to search for
          cin &gt;&gt; userInput; // takes user input
  
          if (userInput.compare("!wq")) // checks user input to see if they still wish to search for a string
          {
              childPID = fork();
  
              if (childPID == 0)
              {
                  while (findResult &lt; longString.length)
                  {
                      findResult = longString.find(userInput, findResult + 1, userInput.length);
  
                      if (findResult &lt; longString.length)
                          matchCount++;
                  }
  
                  cout &lt;&lt; "There are " &lt;&lt; matchCount &lt;&lt; " instances of " &lt;&lt; userInput &lt;&lt; " in longString." &lt;&lt; endl;
              }
              else
                  cout &lt;&lt; "childPID != 0" &lt;&lt; endl;
          }
          else
              cout &lt;&lt; "User has chosen to exit. Exiting." &lt;&lt; endl;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>The error reads:</p>
  
  <p>"wordcount.cpp(57) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?"</p>
  
  <p>I don't believe I need a header file to run this code. Thank you for all your help in advance.</p>