a percent sign? My program asks the user for a percentage rate. It then puts (with cin) the rate into a double. However...if a user tries to type a % after he enters a number...the program goes wack...
rickster11 0 Light Poster
Recommended Answers
Jump to PostReplace..
if(usrInput.c_str()[usrInput.length()-1]=='%') ...
with
if(usrInput[usrInput.length()-1] == '%')
All 4 Replies
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
tux4life 2,072 Postaholic
cikara21 37 Posting Whiz
tux4life commented: Useful comment +1
tux4life 2,072 Postaholic
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.