| | |
Parse integers from string?
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
dwk
Seek and ye shall find.
"Only those who will risk going too far can possibly find out how far one can go."
-- TS Eliot.
"I have not failed. I've just found 10,000 ways that won't work."
-- Thomas Alva Edison
"The only real mistake is the one from which we learn nothing."
-- John Powell
Seek and ye shall find.
"Only those who will risk going too far can possibly find out how far one can go."
-- TS Eliot.
"I have not failed. I've just found 10,000 ways that won't work."
-- Thomas Alva Edison
"The only real mistake is the one from which we learn nothing."
-- John Powell
atoi is a C function that works in C++.e.g.:
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <cstdio> #include <cstring> int main() { char s[80]; int i; cin>>s; i = atoi(s); cout>>i; return 0; }
My C++ is a little rusty, but that's my example. Using the
String class might be a little dirrerent. You mean string (lowercase 's').
atoi() is a non-standard function; if you have it, it would be in <cstdlib>.
If you insist on using C functions, see this link: http://faq.cprogramming.com/cgi-bin/...&id=1043284385
atoi() is a non-standard function; if you have it, it would be in <cstdlib>.
If you insist on using C functions, see this link: http://faq.cprogramming.com/cgi-bin/...&id=1043284385
dwk
Seek and ye shall find.
"Only those who will risk going too far can possibly find out how far one can go."
-- TS Eliot.
"I have not failed. I've just found 10,000 ways that won't work."
-- Thomas Alva Edison
"The only real mistake is the one from which we learn nothing."
-- John Powell
Seek and ye shall find.
"Only those who will risk going too far can possibly find out how far one can go."
-- TS Eliot.
"I have not failed. I've just found 10,000 ways that won't work."
-- Thomas Alva Edison
"The only real mistake is the one from which we learn nothing."
-- John Powell
dwk
Seek and ye shall find.
"Only those who will risk going too far can possibly find out how far one can go."
-- TS Eliot.
"I have not failed. I've just found 10,000 ways that won't work."
-- Thomas Alva Edison
"The only real mistake is the one from which we learn nothing."
-- John Powell
Seek and ye shall find.
"Only those who will risk going too far can possibly find out how far one can go."
-- TS Eliot.
"I have not failed. I've just found 10,000 ways that won't work."
-- Thomas Alva Edison
"The only real mistake is the one from which we learn nothing."
-- John Powell
I wouldn't use atoi in c++, assuming of course _jsw's sources are correct
http://www.daniweb.com/techtalkforums/thread39691.html
http://www.daniweb.com/techtalkforums/thread39691.html
*Voted best profile in the world*
![]() |
Similar Threads
- Parse a concatenated variable and string? (PHP)
- (C) have 2 parse errors (help) (C)
- Making hashes on the fly with name dictated by a variable string (Perl)
Other Threads in the C++ Forum
- Previous Thread: drink machine
- Next Thread: Inserting in a sorted linked list(sorted alphabetically)
Views: 15556 | Replies: 7
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays assignment beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data database delete desktop developer directshow dll encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream input int integer java lazy lib linux loop looping loops map math matrix memory multidimensional newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort string strings struct studio system template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets







