[01:52] <~Nikumubeki> Because it's MBEGGAR BEGS LIKE A BEGONI.
This is the static archive of the Massassi Forums. The forums are
closed indefinitely. Thanks for all the memories!
You can also download
Super Old Archived Message Boards
from when Massassi first started.
"View" counts are as of the day the forums were archived, and will no longer increase.
//INSERT INTO tblname(col1,col2,col3) VALUES(a,b,c) WHERE emp_id=nEmpID bool BST::InsertRecord(int nEmpID, float fSalary, char *strFName, char *strLName) { int nRecordNum=H(nEmpID); //Hash. EMPDATA eData; if (SearchRecord(nRecordNum,false,eData)) //Collision detected..resolve { nRecordNum+=100; if (SearchRecord(nRecordNum,false,eData)) //Still yet a collision...problems { int nTmp=ProbeRecords(nRecordNum); if (nTmp=-1) { cout<<"There is no more room for this record.\n"; return false; //We're all filled up! } nRecordNum=nTmp; } } eData.nEmployeeID=nEmpID; eData.fSalary=fSalary; strcpy(eData.strFName,strFName); strcpy(eData.strLName,strLName); //Write to file m_fout.seekp(sizeof(EMPDATA)*nRecordNum); m_fout.write(reinterpret_cast<const char*>(&eData),sizeof(EMPDATA)); m_fout.flush(); RecursiveInsert(m_pRoot,nEmpID,nRecordNum); //insert record # into tree return true; }