I've written a calculator program but at the moment I'm not getting the right calculation results. I want the program to convert the character input into a double data type.
I tried using the function atof but this didn't work. does anyone have any solutions?
double add(double x, double y)
{...
Cheers for all your replys I,ve not tried most of them yet as I've been changing my calculator program's code to use functions and case statements, once I've figured out where to put your code I'll let you know how they worked.
Cheers both of you for your help. Chipper when i tried your suggestion if i enter a number and hit enter, the program goes to the next line and i have to enter the number again for the program to process the information. Do you have any suggestions to rectify this or is there nothing I can do?
I've written a small program, part of the program asks the user to input two numbers. How do I go about testing the numbers to check that the user did input an integer and not a character by accident. I ve tried the folowing:
label:
cout << "Please enter a number: ";
cin >>...
Hi, I know this is supposed to be simple but I can't figure what variable(s) I would use if I was writing a program that prompts a user to enter a character, the program then displays a message if the user entered an integer or a letter. I know the program uses an if-else statement but I don't...
Can anybody please help?
I have an application that has an intro leading to a menu screen. Using 'go to the frame' the application waits until a user clicks a button moving to another screen. I would like the application to reset itself to the start if the menu screen is idle for a certain...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.