2

So, the question is as follows: I have an input data, loaded into cin, which (data) has no separators at all and consists of 2-dig. hex numbers, for ex:

ab2b6f //here it is ab 2b 6f 

Is it possible to separate them without buffering? I do not want to waste a memory, 'cause inputs can be really long;

UPD: solved by using 2-char buffer.

===================================

doctor_mee
  • 19
  • 4

1 Answers1

0

You may set an input buffer as described here: How to get IOStream to perform better? and then istream::read(...) an exact number of bytes from the stream.

Community
  • 1
  • 1
user3159253
  • 16,836
  • 3
  • 30
  • 56