Someone help/direct me to understand where I have made the below errors from the build report?

#include <iostream>

using namespace std;

int main()
{

}
void "welcome_screen"()
	{
	clrscr();
	textcolor(RED);
	gotoxy(10,10);
	cout<<"**************** W E L C O M E  *********************** ";
	gotoxy(15,12);
	cout<<"*** T O  M A N C H E S T E R   U N I T E D  *** " ;
	gotoxy(10,14);
	textcolor(RED);
	cout<<"******* C L U B  M A N A G E M E N T  ******* ";
	gotoxy(28,16);
	textcolor(RED);
	gotoxy(10,20);
	cout<<"";

	textcolor(RED+BLINK);
	gotoxy(20,30);
	cout<<" *** PRESS ANY KEY TO CONTINUE***";
	getch();
	return 0;
     }

Compiling: Untitled1.c

C:\Users\***\Downloads\Main project\Untitled1.c:1:20: error: iostream: No such file or directory

C:\Users\***\Downloads\Main project\Untitled1.c:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'

C:\Users\***\Downloads\Main project\Untitled1.c:9: error: expected identifier or '(' before string constant

Process terminated with status 1 (0 minutes, 0 seconds)
3 errors, 0 warnings

Recommended Answers

All 8 Replies

what compiler are you using? Many old c++ compilers use now-deprecated iostream.h

what compiler are you using? Many old c++ compilers use now-deprecated iostream.h

This was in Code:blocks 10.5

Many old c++ compilers use now-deprecated iostream.h

For the record, deprecated means that something is in the C++ standard but not recommended because it might be removed in future revisions. iostream.h wasn't, and isn't, part of the standard at all.

error: iostream: No such file or directory
error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'

This is nearly always due to using an old compiler with modern code. If your compiler supports ISO standard C++, then you might have a corrupted installation or be compiling as C rather than C++.

error: expected identifier or '(' before string constant

You're trying to use a string literal as a function identifier. The function body is also using library features from the conio library, which isn't portable. I wouldn't expect all of those function calls to work unless you're using a Borland compiler.

Hello wakesta,
You are using getch() and gotoxy() functions functions, but you haven't included conio.h.

For the record, deprecated means that something is in the C++ standard but not recommended because it might be removed in future revisions. iostream.h wasn't, and isn't, part of the standard at all.

You are right, but its still referred to as deprecated, for example here

The pre-ISO C++ headers (iostream.h, defalloc.h etc.) are available, unlike previous libstdc++ versions, but inclusion generates a warning that you are using deprecated headers.

You are right, but its still referred to as deprecated, for example here

Deprecated for libstdc++, not the C++ standard. There's a distinction because the deprecated status is dependent on one using that particular library.

check on line 29 Wakesta, you have given return(0), but your function is of the type void.

Thanks for help, the next question is I need to understand/advice where I include the next parts or the best way I do this:

squad Players

strcpy(r2player[1].pname,"Edwin Van Der Sar");
strcpy(r2player[2].pname,"Patrice Evra");
strcpy(r2player[3].pname,"John O'Shea");
strcpy(r2player[4].pname,"Rio Ferdinand");
strcpy(r2player[5].pname,"Nemanja Vidic");
strcpy(r2player[6].pname,"Darren Fletcher");
strcpy(r2player[7].pname," Michael Carrick");
strcpy(r2player[9].pname," Ryan Giggs");
strcpy(r2player[10].pname," Carlos Tevez");
strcpy(r2player[11].pname," Wayne Rooney");
strcpy(r2player[13].pname," Rafael De Silva");
strcpy(r2player[14].pname," Ji Sung Park");
strcpy(r2player[15].pname," Dimitar Berbatov");
strcpy(r2player[16].pname," Johny Evans");
strcpy(r2player[17].pname," Paul Scholes");
ob.week=0;
ob.tot_goals=0;
ob2.week=0;
ob2.tot_goals=0;
query++;
//initiations of goals from 0
for(int i=1;i<=17;i++)
{
r2player[i].goals=0;
}

//specify salary given to each player
r2player[1].salary=5000;
r2player[2].salary=3000;
r2player[3].salary=4000;
r2player[4].salary=5000;
r2player[5].salary=4500;
r2player[6].salary=3500;
r2player[7].salary=4000;
r2player[9].salary=6000;
r2player[10].salary=5000;
r2player[11].salary=6500;
r2player[13].salary=2500;
r2player[14].salary=3000;
r2player[15].salary=4000;
r2player[16].salary=3000;
r2player[17].salary=5000;
//ob.tot_sal=0;
//for(int j=1;j<=17;j++)
//{
//ob.tot_sal+=player[j].salary;
//}

Transfer Market

//Tranfer Players
strcpy(tplayer[1].tname,"Roque Santa Cruz");
tplayer[1].tsal=3000;
strcpy(tplayer[2].tname,"Lionel Messi");
tplayer[2].tsal=6500;
strcpy(tplayer[3].tname,"Amir Zaki");
tplayer[3].tsal=3000;
strcpy(tplayer[4].tname,"Ricardo Kaka");
tplayer[4].tsal=5500;
strcpy(tplayer[5].tname,"Ibrahamovic");
tplayer[5].tsal=4500;
strcpy(tplayer[6].tname,"Luka Modric");
tplayer[6].tsal=4000;
strcpy(tplayer[7].tname,"Peter Crouch");
tplayer[7].tsal=3000;
strcpy(tplayer[8].tname,"Bastian Schweinsteiger");
tplayer[8].tsal=4000;
strcpy(tplayer[9].tname,"Deco");
tplayer[9].tsal=4500;
strcpy(tplayer[10].tname,"Franck Ribery");
tplayer[10].tsal=5000;
strcpy(tplayer[11].tname,"Karim Benzema");
tplayer[11].tsal=2500;
strcpy(tplayer[12].tname,"Mamadou Sakho");
tplayer[12].tsal=2000;
strcpy(tplayer[13].tname,"Wilson Palacios");
tplayer[13].tsal=2500;
strcpy(tplayer[14].tname,"Douglas Costa");
tplayer[14].tsal=2500;
strcpy(tplayer[15].tname,"Nicolas Bertolo");
tplayer[15].tsal=3000;

League Table

//EPL Teams:
strcpy(team[1].team_name,"Liverpool");
team[1].skill=18;
strcpy(team[2].team_name,"Chelsea");
team[2].skill=18;
strcpy(team[3].team_name,"Arsenal");
team[3].skill=17;
strcpy(team[4].team_name,"Aston Villa");
team[4].skill=15;
strcpy(team[5].team_name,"Everton");
team[5].skill=14;
strcpy(team[6].team_name,"Fulham");
team[6].skill=13;
strcpy(team[7].team_name,"Tottenham");
team[7].skill=15;
strcpy(team[8].team_name,"West Ham United");
team[8].skill=13;
strcpy(team[9].team_name,"Manchester City");
team[9].skill=15;
strcpy(team[10].team_name,"Wigan Athletic");
team[10].skill=13;
strcpy(team[11].team_name,"Stoke City");
team[11].skill=12;
strcpy(team[12].team_name,"Bolton Wanderers");
team[12].skill=12;
strcpy(team[13].team_name,"Blackburn Rovers");
team[13].skill=13;
strcpy(team[14].team_name,"Wolves");
team[14].skill=13;
strcpy(team[15].team_name,"Sunderland");
team[15].skill=12;
strcpy(team[16].team_name,"Newcastle United");
team[16].skill=11;
strcpy(team[17].team_name,"Hull City");
team[17].skill=10;
strcpy(team[18].team_name,"Blackpool");
team[18].skill=9;
strcpy(team[19].team_name,"West Bromwich Albion");
team[19].skill=7;

ob.mskill=19;
}

Transfer Week

void transferweek()
{
clrscr();
char c;
int p,s,g;
cout<<"\tWeek 20";
cout<<"\nTRANSFER WEEK";
cout<<"Rules:\n";
cout<<"1)For buying a player, one player has to be sold";
cout<<"\n2)Value ofbought player has to be equal of less than\n sold player\n";
cout<<"\n Do you want to buy?(y/n)";
cin>>c;
switch(c)
{
case 'y':
case 'Y':
s=0;
break;
case 'n':
case 'N':
s=1;
break;
}
while(s=0)
{
cout<<"\nPress number next to desired player\nList of players:\n";
for(int i=1;i<=15;i++)
{
cout<<i;
puts(tplayer[i].tname);
cout<<"---"<<tplayer[i].tsal<<"\n";
}
cin>>p;
clrscr();
cout<<"\n Which player to sell?\n";
for(int q=1;q<=17;q++)
{
cout<<g;
puts(r2player[q].pname);
cout<<"---"<<r2player[q].salary<<"\n";
}
cin>>g;
if(r2player[g].salary>=tplayer[p].tsal)
{
strcpy(r2player[g].pname,tplayer[p].tname);
cout<<"\n \t Negotiations Accomplished. Congratulations!";
}
else
{}
cout<<"\n Another transfer? \n0.Yes 1.No\n";
cin>>s;
}}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.