954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Converting String to Integer help

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.

wigster84
Newbie Poster
10 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
 
SpS
Posting Pro
599 posts since Aug 2005
Reputation Points: 70
Solved Threads: 32
 

Thanks so much.

wigster84
Newbie Poster
10 posts since Jan 2006
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You