missing type specifier

For the life of me I cannot figure out why I'm getting this error on what I'm assuming is a very simple program. I have tried google and see a bunch of other people with the same problem, but have failed to find a solution that works for me.

Visual Studio gives me this error "missing type specifier - in assumed. Note: C++ does not support default-int"

Any ideas?

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
#include <iostream>
#include <ctime>

using namespace std;


main() {

	srand((unsigned int)time(0));

	int rarity = (1 + rand() % 3);

	if (rarity == 1) {
		cout << "Water";
	}
	if (rarity == 2) {
		cout << "Fire";
	}
	if (rarity == 2) {
		cout << "Wind";
	}

	system("PAUSE");
	return 0;
}
> missing type specifier - int assumed. Note: C++ does not support default-int

1
2
// main() {
int main() {
main() should be int main()
Dammit! Why didn't I see that! Sorry guys thank you!!!
Topic archived. No new replies allowed.