Employee& Database::addEmployee(string inFirstName, string inLastName)
{
if (mNextSlot >= kMaxEmployees) {
cerr << “There is no more room to add the new employee!” << endl;
throw exception();
}
Employee& theEmployee = mEmployees[mNextSlot++];
theEmployee.setFirstName(inFirstName);
theEmployee.setLastName(inLastName);
theEmployee.setEmployeeNumber(mNextEmployeeNumber++);
theEmployee.hire();
return theEmployee;
}
The source code is from c++ professional, not complete source code.
Can I write somthing like this in php...Is it possible? if so can you show me. I'm just learning php..thanks
Aucun commentaire:
Enregistrer un commentaire