> I was looking for some hints
The hint was 'divide and conquer'. In retrospect, the post would perhaps have been better if had given just the declarations of the three functions after that.
> I didn't understand the behavior of "if( !( stm >> field ) )"
stm >> field
tries to extract
field
from
stm
and returns a reference to
stm
. If the attempt to extract
field
failed,
stm
would be in a failed state.
1 2
|
// if the stream input failed, indicate failure by returning an empty string
if( !( stm >> field ) ) return "" ;
|
> ... the ">>" operator ... makes my problem simple
C++ now has
std::stof()
http://en.cppreference.com/w/cpp/string/basic_string/stof
If your implementation has
std::stof()
, you could just use that.
> Inside the for-loop "for( int i = 0 ; i<=column ; ++i )" it had to be a "<=" operator in the middle to find the right column.
There is one column less in the line once you cut the marker from the line.
With 'the marker can now be anywhere in the line.' and
'cuts the marker of and returns the rest of the line.'
what would happen if the marker was originally
after the required column?