Hey! Again, small but devious problem for me: I have a string that gets time as an input, in a format like "9.45" or "15.37". How do I extract the hours and minutes to integer variables, when the hour part may consist of either one or two digits? If it was just one digit from 0-9 I could just pick the chars up and convert them, but now I can't figure out the solution... :-/ Maybe I haven't had enough coffee today!
bleedi
3
Junior Poster in Training
Recommended Answers
Jump to PostSee if the content of this thread http://www.daniweb.com/forums/thread27905.html will help you. Basically, you can use a string stream with getline using a delimiter (analogous to using getline with a delimiter on an input stream).
All 3 Replies
jonsca
1,059
Quantitative Phrenologist
Team Colleague
Featured Poster
tesuji
135
Master Poster
bleedi
3
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.