Changes

Jump to: navigation, search

Q2 A binary file question

73 bytes removed, 18:38, 4 August 2010
no edit summary
Write the following function:<br>
'''void Process(fstream& fs, int recsize);'''<br> 0 false 18 pt 18 pt 0 0 false false false 
This function is passed an instance of fstream fs. fs is associated with a file that is open in binary mode for both reading and writing (so don't try to open the file because it is already open). The second parameter recsize is the size (number of bytes) of one record in the file associated with fs. The last two bytes of each record is always CR and LF respectively. Your function needs to read out each record then write it back into the file such that the CR at the end of each record is removed.</br>
NOTE: it is important that you only remove the CR from the end of the records. If they occur elsewhere within the record you should ignore it.<br>

Navigation menu