I have a user input an integer... But if it's really long, it throws an exception and starts looping infinitely. How would I make it cut the number after the first 7 digits and only use that? Like, if I inputted 654897654321648435435135813513843513543514, it would only accept 6548976. Please help.
stupendousomega
0
Newbie Poster
Recommended Answers
Jump to Postget the data as a std::string then convert it to integer.
All 4 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
stupendousomega
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
mrnutty
761
Senior Poster
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.