I am reading data from a stream into a char array of a given length, and I would like the maximum reading width to be large enough to fit into this char array.
The reason I use a char array is because part of my specification is that the length of any single token cannot exceed a certain value, so I save some constructor calls.
I thought width () did what I wanted, but I was clearly wrong ...
EDIT: I use stream extraction operators to perform extraction, as these are text text files with values separated by spaces.
source
share