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.

Recommended Answers

All 2 Replies

Thanks so much.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.