| | |
Converting String to Integer help
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jan 2006
Posts: 10
Reputation:
Solved Threads: 0
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.
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.
![]() |
Similar Threads
- to convert string to integer value (Legacy and Other Languages)
- Converting a String into an integer array (C)
- String to integer conversion (C)
- Convert a string to an integer (PHP)
- Conversion and searching with a string help (C++)
- String to integer to ascii (C)
Other Threads in the C++ Forum
- Previous Thread: C++ Books
- Next Thread: Header help!
| Thread Tools | Search this Thread |
api array based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock wordfrequency wxwidgets





