11.07.2015 Views

tYSR20

tYSR20

tYSR20

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

198Part III: Introduction to Classes}// getData - read a name and social security// number; return null if no more to// readNameDataSet* getData(){// read the first namechar nameBuffer[128];cout > nameBuffer;// if the name entered is ‘exit’...if ((stricmp(nameBuffer, “exit”) == 0)){// ...return a null to terminate inputreturn 0;}// get a new entry to fillNameDataSet* pNDS = new NameDataSet;// fill in the name and zero the link pointerstrncpy(pNDS->szName, nameBuffer, 128);pNDS->szName[127] = ‘\0’; // ensure string is terminatedpNDS->pNext = 0;}// return the address of the object createdreturn pNDS;int main(int nNumberofArgs, char* pszArgs[]){cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!