void view(string); //error: variable or field 'view' declared void & error: 'string' was not declared in this scope
void customer()
{
char ch;
ch=getche();
switch(ch)
{
case'1':break;
case'2':view("customer.txt"); //error: 'view' was not declared in this scope
case'3':break;
case'b':main_menu();
}
}
void view(string fname) //error: variable or field 'view' declared void & error: 'string' was not declared in this scope
{
string line;
ifstream myfile (fname);
if (myfile.is_open())
{
while ( getline (myfile,line) )
{
cout << line << '\n';
}
myfile.close();
}
else
{
std::cout<<"\nError Can't Open File !";
}
}
int main()
{
view("customer.txt");
return 0;
}