2000Fall

Setbackgroundcoloryellow frameshow 3 i

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: amp;&0,% % 5& +" readFile { open the file; determine the size of the file; allocate that much memory; read the file into memory; close the file; } #$&$5&&0,&  % • • • $5&A $&,$5$5&A  $ %%55 + • $5& , 5&% • $5&A&%  &5$  %$  $&,0& errorCodeType readFile { initialize errorCode = 0; open the file; if (theFileIsOpen) { determine the length of the file; if (gotTheFileLength) { allocate that much memory; if (gotEnoughMemory) { read the file into memory; if (readFailed) { errorCode = -1; } } else { errorCode = -2; } } else { errorCode = -3; } close the file; if (theFileDidntClose && errorCode == 0) {  F errorCode = -4; } else { err...
View Full Document

This document was uploaded on 03/11/2014.

Ask a homework question - tutors are online