#include
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 > 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 < longString.length)
{
findResult = longString.find(userInput, findResult + 1, userInput.length);
if (findResult < longString.length)
matchCount++;
}
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/20113280/fatal-error-c1010-stdafx-h-in-visual-studio-how-can-this-be-corrected[/url]
Я компилирую следующий код, но получаю ошибку компиляции в Visual Studio, которую не могу понять. [code]#include
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 > 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 < longString.length) { findResult = longString.find(userInput, findResult + 1, userInput.length);
if (findResult < longString.length) matchCount++; }