Erorr C2447 '{' Missing function header

I am trying to build an RPG Battle system

Page 1 of 1

1 Replies - 572 Views - Last Post: 11 April 2008 - 08:10 AM Rate Topic: -----

#1 Chibi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 11-April 08

Erorr C2447 '{' Missing function header

Posted 11 April 2008 - 07:30 AM

I am trying to build a battle program similar to most RPG's I am still not completely done with it yet but I was building it to check for erorrs and I keep getting the error stated above. If someone could help me that would be greatly appreciated. Also If someone could tell me how to use the random function I would appreciate it but I don't expect it since I can just find it on the net. Thank you all for your help.


#include<iostream>
using namespace std; 
#include <string>
#include <iomanip>
#include <windows.h>
#include <dos.h>
int main (int argc, char * argv[]);
{

int Hero_HP;
int Hero_MP;
int Hero_AP;
int Hero_Strength;
int Hero_Dexterity;
int Hero_Intellegence;
int Hero_Attack;
int Hero_Defense;
int Hero_Accuracy;
int Potion_Inventory;
int Battle;

	  while (Battle = 1);
	  {
			if (Battle = 1 )
			
			{cout << "Your Options are " << '\n';
			cout << "Attack - 1" << '\n';
			cout << "Item - 2" << '\n';
			}

			if (Hero_Class == 1)
			{
				cout << "3 - Whirl Wind Attack";
				cout << "		 This Attack will strike all the Enemies MP Cost: 5" << '\n';
				cout << "4 - Wild Swing" << '\n';
				cout << "		 Attack with low accurracy but if it hits will do critical damage MP Cost: 5" << '\n';
			}
			if (Hero_Class == 2)
			{
				cout << "3 - Hide" << '\n';
				cout << "		  Makes player harder to hit for 5 turns MP Cost: 5" << '\n';
			}
			if (Hero_Class == 3)
			{
				cout << "Cure Light wounds - 3" << '\n';
				cout << "			Heals 20 HP MP Cost: 5" << '\n';
				cout << "Fireball - 4" << '\n';
				cout << "			Shoot fire to damage enemies MP Cost: 5 " << '\n';
				cout << "Energy Sheild - 5" << '\n';
				cout <<			  "Armor temporally Increased for 5 Turns MP Cost: 5" << '\n';
				cout << "Firewall - 6" << '\n';
				cout <<			  "Sightly increase defence, if hit enemy also delt damage MP Cost: 10";
			}
			Player_Select;
			cin >> Player_Choice;
			Enemy_Select:
			cout << "What Enemy do you want to hit ?";
			cin >> Enemy_Choice;
			if (Enemy_Choice == 1 && Enemy_HP_1 == 0)
			{
				cout << "That Enemy is dead please choose anouther";
				goto Enemy_Select
			}
			if (Enemy_Choice == 2 && Enemy_HP_2 == 0)
			{
				cout << "That Enemy is dead please choose anouther";
				goto Enemy_Select
			}
			if (Enemy_Choice == 3 && Enemy_HP_3 == 0)
			{
				cout << "That Enemy is dead please choose anouther";
				goto Enemy_Select
			}
			if (Hero_Class == 1)
			{
				cout << "Please choose the Enemy you want to strike";

				switch (Player_Choice)
				{
				case 1:
				
				if (Enemy_Choice == 1)
				{
					if ( (Hero_Dexterity + RANDOM NUMBER) > (Enemy_Dexterity_1 + RANDOM NUMBER)
					{
						Enemy_HP_1 = Enemy_HP_1 - (3 *(1.5 * Current_Level);
					}
				}
				if (Enemy_Choice == 2)
				{
					if ( (Hero_Dexterity + RANDOM NUMBER) > (Enemy_Dexterity_2 + RANDOM NUMBER)
					{
						Enemy_HP_2 = Enemy_HP_2 - (3 *(1.5 * Current_Level);
					}
				}
				if (Enemy_Choice == 3)
				{
					if ( (Hero_Dexterity + RANDOM NUMBER) > (Enemy_Dexterity_3 + RANDOM NUMBER)
					{
						Enemy_HP_3 = Enemy_HP_3 - (3 *(1.5 * Current_Level);
					}
				}
				break;
				case 2:
				if (Item_Choice == 1)
				
				break;

				case 3:
				Enemy_HP_1 = Enemy_HP_1 - (3 *(1.25 * Current_Level);

				Enemy_HP_2 = Enemy_HP_2 - (3 *(1.25 * Current_Level);

				Enemy_HP_3 = Enemy_HP_3 - (3 *(1.25 * Current_Level);
				break;

				case 4:
				if (Enemy_Choice == 1)
				{
					if ( (Hero_Dexterity + RANDOM NUMBER - 5) > (Enemy_Dexterity_1 + RANDOM NUMBER)
					{
						Enemy_HP_1 = Enemy_HP_1 - (3 *(2 * Current_Level);
					}
				}
				if (Enemy_Choice == 2)
				{
					if ( (Hero_Dexterity + RANDOM NUMBER - 5) > (Enemy_Dexterity_2 + RANDOM NUMBER)
					{
						Enemy_HP_2 = Enemy_HP_2 - (3 *(2 * Current_Level);
					}
				}
				if (Enemy_Choice == 3)
				{
					if ( (Hero_Dexterity + RANDOM NUMBER - 5) > (Enemy_Dexterity_3 + RANDOM NUMBER)
					{
						Enemy_HP_3 = Enemy_HP_3 - (3 *(2 * Current_Level);
					}
				}
				}
			}
			if (Hero_Class == 2)
			{
				switch (Player_Choice)
				{
				case 1:
				
				if (Enemy_Choice == 1)
				{
					if ( (Hero_Dexterity + RANDOM NUMBER) > (Enemy_Dexterity_1 + RANDOM NUMBER)
					{
						Enemy_HP_1 = Enemy_HP_1 - (3 *(1.5 * Current_Level);
					}
				}
				if (Enemy_Choice == 2)
				{
					if ( (Hero_Dexterity + RANDOM NUMBER) > (Enemy_Dexterity_2 + RANDOM NUMBER)
					{
						Enemy_HP_2 = Enemy_HP_2 - (3 *(1.5 * Current_Level);
					}
				}
				if (Enemy_Choice == 3)
				{
					if ( (Hero_Dexterity + RANDOM NUMBER) > (Enemy_Dexterity_3 + RANDOM NUMBER)
					{
						Enemy_HP_3 = Enemy_HP_3 - (3 *(1.5 * Current_Level);
					}
				}
				
				break;
				case 2:
				if (Item_Choice == 1)
				break;
				case 3:
					hide = 5;
				break;
			}
				}
			if (Hero_Class == 3)
			{
			switch (Player_Choice)
				{
				case 1:
				
				if (Enemy_Choice == 1)
				{
					if ( (Hero_Dexterity + RANDOM NUMBER) > (Enemy_Dexterity_1 + RANDOM NUMBER)
					{
						Enemy_HP_1 = Enemy_HP_1 - (3 *(1.5 * Current_Level);
					}
				}
				if (Enemy_Choice == 2)
				{
					if ( (Hero_Dexterity + RANDOM NUMBER) > (Enemy_Dexterity_2 + RANDOM NUMBER)
					{
						Enemy_HP_2 = Enemy_HP_2 - (3 *(1.5 * Current_Level);
					}
				}
				if (Enemy_Choice == 3)
				{
					if ( (Hero_Dexterity + RANDOM NUMBER) > (Enemy_Dexterity_3 + RANDOM NUMBER)
					{
						Enemy_HP_3 = Enemy_HP_3 - (3 *(1.5 * Current_Level);
					}
				}
				break;
				case 2:
				if (Item_Choice == 1)
				break;
				case 3:
				Hero_HP = Hero_HP + 20;
				break;
				case 4:
				if (Enemy_Choice == 1)
				{
					if ( (Hero_Dexterity + RANDOM NUMBER) > (Enemy_Dexterity_1 + RANDOM NUMBER)
					{
						Enemy_HP_1 = Enemy_HP_1 - (3 *(1.5 * Current_Level);
					}
				}
				if (Enemy_Choice == 2)
				{
						Enemy_HP_2 = Enemy_HP_2 - (3 *(1.5 * Current_Level);
				}
				if (Enemy_Choice == 3)
				{
						Enemy_HP_3 = Enemy_HP_3 - (3 *(1.5 * Current_Level);
				}
				break;
				case 5:
					Energy_Sheild = 5;
				break;
				case 6:
					Energy_Sheild = 5;
				break;
			}
			}
			Enemy1(ATTACKS)
			Enemy2(ATTACKS)
			Enemy3(ATTACKS)
		End If
	if (Enemy_1_HP = 0 & Enemy_2_HP = 0 & Enemy_3_HP = 0)
	{ 
		Battle = 0
	}
	}
	}




Is This A Good Question/Topic? 0
  • +

Replies To: Erorr C2447 '{' Missing function header

#2 jeronimo0d0a  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 146
  • Joined: 03-March 08

Re: Erorr C2447 '{' Missing function header

Posted 11 April 2008 - 08:10 AM

Two things to get you started. First, remove the ; at the end of the line main(......) ; Then you will find a lot of undeclared variables in your error messages but they're a lot easier to find and fix. Then be aware that none of your variables are initialized. ex.
int Battle_Mode = ?;
int soldiers_on_field = 4;


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1