Anyone knows what does these errors mean ?
Error E2108 workingArea.cpp 61: Improper use of typedef 'string' in function newCode()
Error E2121 workingArea.cpp 61: Function call missing ) in function newCode()
*** 2 errors in Compile ***
Code:
int main()
{
string billy [12];
int tester;
while((tester >= 1) || (tester < 4))
{
cout << "select one of these options\n";
cout << "(1) Insert a new code\n";
cout << "(2) Print the data\n";
cout << "(3) Program requirments\n";
cout << "(4) Exit the program\n";
cin >> tester;
if(tester==1)
newCode();
else if (tester==2)
printCode();
else if (tester==3)
errorCode();
else if (tester==4)
break;
else
cout << "ERROR!!! You must choose one of the options from 1 to 4";
}
return 0;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void newCode()
{
string serial_number;
int length;
cout<< "please enter a serial number of 12 characters:";
cin >> serial_number;
length = serial_number.length();
std::string mystr = serial_number;
if (length!=12 )
cout << "There must be 12 characters exactly";
else
checkOne(string serial_number);
}
void checkOne( string serial_number)
{
std::string mystr = serial_number;
for( int i=0; i<13;i++)
{
if( mystr[i]!= '4')
break;
cout << "correct"<<endl;
}
}