Need help with error prompt.

I am trying to make a prompt but I keep getting errors saying type name not allowed and others. I would like to know is this the correct way to go by in making an error prompt to let people know that it needs to be a name inputted. Also, if a number has to be inputted to prevent letters being used? Thank you in advance.

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
 #include "iostream"
#include "stream"
#include "string"

using namespace std;

int main()
{
	string driver1, driver2, driver3,
		color1, color2, color3,
		laptime1, laptime2, laptime3;

	int number1, number2, number3,
		laptimeM1, laptimeS1,
		laptimeM2, laptimeS2,
		laptimeM3, laptimeS3;


	// Car1 Info
	cout << "Who is the driver for car one? ";
	getline(cin, driver1);

	try {

		if ( driver1 = int ) {

			throw ERROR!

		}

	}

	catch (string x) {

		cout << "Only looking for letters for the drivers name." << x << endl;

	}

Topic archived. No new replies allowed.