| | |
help please
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Feb 2009
Posts: 13
Reputation:
Solved Threads: 0
hey guys, ok here's the situation. i need to turn a C++ style string into an integer now i've used altoi and strtol but they give me different numbers. heres my code
and my output is
can anybody explain this to me?
C++ Syntax (Toggle Plain Text)
cout << file << endl << file.c_str() << endl; // debugging purposes num = strtol(file.c_str(), &pEnd, 10); // actual conversion return num; // return
and my output is
C++ Syntax (Toggle Plain Text)
8178858588 8178858588 2147483647 (where i printed out the return)
can anybody explain this to me?
0
#2 20 Days Ago
What's the largest value that can be stored in a long int?
How does that limit compare to the value you're trying to stuff into a long int?
How does that limit compare to the value you're trying to stuff into a long int?
"We Americans got so tired of being thought of as dumb by the rest of the world that we went to the polls last November and removed all doubt."
~~~~~~~~~~~~~~~~~~
Looking for an exciting graduate degree? Robotics and Intelligent Autonomous Systems (RIAS) at SDSM&T See the program brochure here.
~~~~~~~~~~~~~~~~~~
Looking for an exciting graduate degree? Robotics and Intelligent Autonomous Systems (RIAS) at SDSM&T See the program brochure here.
![]() |
Other Threads in the C++ Forum
- Previous Thread: compiling multiple files using visual c++
- Next Thread: How to make the cout work when input is not integer in this simple program?
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






