cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
extracting numerical values
extracting numerical values
Dec 28, 2011 at 9:49pm UTC
Windwhistles
(49)
In your opinion, what is the best way to extract numerical values from the user:
stringstream, or string conversion functions(atof, atoi, strtod, ect...).
Thanks.
Dec 28, 2011 at 11:14pm UTC
keeyon2
(10)
are you going to have to convert these values to a different type? like will you be converting the imported numbers (int) to a string or character later?
If you are going to keep it as an int always, I would just do this
int x;
cin >> x;
Topic archived. No new replies allowed.