Data is input from a text file containing on each line an alphabetic name followed by a numberic value. After the data is input via an istream object, the numeric value is intended to be used as an unsigned int, but isn't is it still a set char values? I suspect an explicit conversion is needed to use the value as intended. Correct?
If so, please include an example. Thanks.
Also, anyone have any more info for my char/string thread?
Yes it would be. You would either need to use a function like atoi() or make your own. Or, you can simply get to where you know the integer starts and ends and do something like this:
file>>yourInt; //this will work as long as you don't have random data that could confuse the stream
You are currently defining name as a char, which is a single character. I think you wanted an std::string instead.
I think that with the way the >> operator works with streams, it will stop at the first space, so you will probably be OK with just stacking it like you did.
Whoops, I meant for you to put whatever you called your int variable there ^^;;
Will edit...