I'm trying to write a program for my c++ class that takes binary numbers and converts them to decimal. I have programmed this all fine and dandy, but I'm having trouble with my EOF statement. The program requires that I use 3 functions, the first being to prompt user for 8 digit max binary number, the second converts it to decimal, and the third function displays the results.
I have everything coded perfectly so far, but the teacher wants me to have the user type '@' when they want to quit the program. Then I should assign @ the value of -1 and send it back to main. When I run my program it freaks out when I type @ because the function is an int function. How do I change it so that I can type '@' without pissing off my computer?
Note: I am not allowed to use arrays, just functions and classes and templates, but I'm not that familiar with classes and templates. PLEASE HELP!!!!!!!!!!!
cbgreene9185 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
cbgreene9185 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
cbgreene9185 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
cbgreene9185 0 Newbie Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured 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.