Hi, Im a beginner at C++...trying to learn it on my own. Im doing an exercise that i cant seem to tackle.

I have to read a set of numbers from a word file seperated by commas and convert them to integers. For example, say my set was

48909, 3453, 7739, 35
34534, 5455, 7344, 40
23423, 5345, 7089, 45
67867, 7853, 7634, 50

After this is done, i have to compare the third row of numbers(7739 7344 7089 7634) with a number given, say 7074. And see how closely related it is.

The explanation i got was that you have to convert the string to integer because thats how C++ will read it. I just need help in converting the string to integers. I want to figure out the rest....so, can anyone help me? (Would i use sprintf ??)

Thanks in advance.

12 Years
Discussion Span
Last Post by wigster84
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.