Would someone mind pointing out to me, as it has been quite a while since I have compiled any C++ code, the reason that the following code is generating an error on my attempt to build it. It is an attempt to build a very basic, entry level, Win32 Console application and the IDE has been configured to expect as much. I thank, in advance, whoever might take the time to point out my oversite. The code is as follows:
#include "stdafx.h"
#include <iostream>
using namespace std;
bool accept()
{
int tries = 1;
while (tries < 4) {
cout << "Do you want to proceed (y or n)?\n";
char answer = 0;
cin >> answer;
switch (answer) {
case 'y':
return true;
case 'n':
return false;
default:
cout << "Sorry, I don't understand that.\n";
tries = tries ++;
}
cout << "I'll take that for a no.\n";
return false;
system("pause");
}
The error message is:
1>c:\users\court\documents\visual studio 2010\projects\cpp1\cpp1\cpp1.cpp(37): fatal error C1075: end of file found before the left brace '{' at 'c:\users\court\documents\visual studio 2010\projects\cpp1\cpp1\cpp1.cpp(10)' was matched The error is as follows:
Again, thank you, in advance for any assistance I might be afforded.