The following question had been asked probably, but I couldn't find it.
I have create a class BinaryWriter
.
I need to implement the following method:
/// Write zero bytes to file
virtual void wr_padding( int padding_size);
I have the following implementation:
void BinaryWriter::wr_padding( int padding_size)
{
char pad_arr[padding_size];
memset(pad_arr, 0, padding_size);
m_stream.write(pad_arr,padding_size);
}
where:
std::ostream m_stream;
I'm not to happy with this implementation. I was hoping to have an ios API for this simple task. Is there more native implementation?
Thanks