can you help me?

line 6 is the error
*expected unqualified-id before '{' token
*expected `,' or `;' before '{' token




#include <iostream>

using namespace std;

int main();
{
int bill,cellphone[3]={2000,2500,1800};
string cp;
double pcs,money,change;
char choice;

menu:
system("cls");
system("color0d");
cout<<" DATE\t\t<<"
"TIME"<<"\n"<<_DATE_<<"\t"<<_TIME_<<endl;
cout<<"\t\t\t\t MENU\n\n";
cout<<"\t\t\t\t1.Nokia - P2000.00\n";
cout<<"\t\t\t\t2.Samsung - P2000.00\n";
cout<<"\t\t\t\t3.Alcatel - P2000.00\n";
cin>>cp;
if(cp=="1")

{
pis:
system("cls");
cout<<"How many pieces you want to buy:";cin>>pcs;
if(pcs<=0);
{
system("cls");
cout<<"Invalid\n\n\n";
system("PAUSE");
goto pis;
}
if(pcs<=9);



system("PAUSE");
return 0;
}
this is not my full code it is just the beginning
int main();

remove semicolon
all error in line 17
In function `int main()':
`_DATE_' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
`_TIME_' undeclared (first use this function)

error in line 43
43 C:\Users\qwerty\Desktop\Untitled1.cpp expected `}' at end of input
these are for precompilation , not for runtime , these are macros not variables .
i change someting in line 17 and there is 1 error left

*expected `;' before "TIME"

and some error that is not have line

*In function `int main()':

here my new code

#include <iostream>

using namespace std;


int main()
{
int bill,cellphone[3]={2000,2500,1800};
string cp;
double pcs,money,change;
char choice;

menu:
system("cls");
system("color0d");
cout<<" DATE\t\t<<"
TIME<<"\n"<<_DATE_<<"\t"<<_TIME_<<endl;
cout<<"\t\t\t\t MENU\n\n";
cout<<"\t\t\t\t1.Nokia - P2000.00\n";
cout<<"\t\t\t\t2.Samsung - P2000.00\n";
cout<<"\t\t\t\t3.Alcatel - P2000.00\n";
cin>>cp;
if(cp=="1")

{
pis:
system("cls");
cout<<"How many pieces you want to buy:";cin>>pcs;
if(pcs<=0);
{
system("cls");
cout<<"Invalid\n\n\n";
system("PAUSE");
goto pis;
}
}
}

Last edited on
Topic archived. No new replies allowed.