fatal error C1075: end of file found before the left brace '{'

I really don't know what is going on with this guys. I know there is still a little bit of work to be done but any help would be appreciated.
I do not have any idea what this error means and if anybody can help me out I would be so grateful.

Thanks in advance.
Kev.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// MyRockPaperScissors.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;

void start();
void two();
void pcompare();
void finish();

int ipp;
int icomchoice;

char cgstart;
char cpchoice;
char cgfinish;

int _tmain(int argc, _TCHAR* argv[])
{
	
	cin>> cgstart;
	switch (cgstart)
	{
	case 'y':
		{
			cout<<"Thanks for playing!\n";
			start();
		}
	case 'n':
		{
			finish();
		}
	
	}
}

void start() 
{
	cout<<"Choose your first hand!\n";
	cin>>cpchoice;

	switch (cpchoice)
	{
	case 'r':
		{
			cout<<"You have chosen Rock!\n";
			ipp = 1;
			cout<<ipp;
			two();
		}

	case 'p':
		{
			cout<<"You have chosen Paper!\n";
			ipp = 2;
			cout<<ipp;
			two();
		}

	case 's':
		{
			cout<<"You have chosen Scissors!\n";
			ipp = 3;
			two();
		}
	default:
		cout<<"Incorrect Input!\n";

		start();
	}
}
void two()
{	
	cout<<"It's the Computers turn!\n";
	srand((unsigned)time(0)); 
	int icomchoice;
		icomchoice = (rand()%3)+1; 
		cout<<icomchoice;
		switch (icomchoice)
		{
		case 1:
			{
				cout<<"The computer has chosen Rock!\n";
				if (ipp=1)
				{
					cout<<"You have both chosen Rock!\n";
					finish();
				}
			}
		case 2:
			{
				cout<<"The computer has chosen Paper!\n";
				if (ipp=1)
				{
					cout<<" You have both chosen Paper!\n";
					finish();

				}
			}

		case 3:
			{
				cout<<" The computer has chosen Scissors!\n";
				if (ipp=1)
				{
					cout<<" You have both chosen Scissors!\n";
					finish();
				
				
			}

		default:
			cout<<"Incorrect Input!\n";
			}
			}

			void finish();

			{
				cout<<"Do you want to play another game?\n";
					cin>>cgfinish;
					switch (cgfinish)
					{
					case 'y':
						{
							start();
						}
					case 'n':
						{
							cout<<"Thankyou for playing! Goodbye.\n";
						}
					
			}
It means you have a brace in the wrong place, or are missing a brace somewhere. The line number reported is important as you're not expected to look thru every line of the program, as you expect us to.

You may want to look at the braces at line 118, there's obviously something wrong there.

Also, you may want to look at the case statements. There is no break after each case.
closed account (z05DSL3A)
I would say you are missing a } at line 112.

Line 121 has a ; and should not.

you are also missing a } at the end.

You have also got a recursive call to start(), this may give you a warning. It would be better to use a while loop in start() not recursive calling.
Last edited on
Thanks guys.
The program is running now.. Just need to sort some other stuff out.

Thanks for the help, I'm a real amateur. lol

Kev.
Topic archived. No new replies allowed.