like this?
do{
printf(" *****Menu*****\n\n1. Pounds to Euro\n2. Pounds to USD\n3. Pounds to Chinese Yen\n4. Pounds to Australian dollar\n5. Pounds to Canadian dollar\n\n");
cin >> menu;...
Type: Posts; User: kie
like this?
do{
printf(" *****Menu*****\n\n1. Pounds to Euro\n2. Pounds to USD\n3. Pounds to Chinese Yen\n4. Pounds to Australian dollar\n5. Pounds to Canadian dollar\n\n");
cin >> menu;...
Hey
I am creating a basic currency converter. I have a simple menu but the problem is there is no error control. Here is the code...
void menu(void)
{
int menu;
int valid = 0;
Could be some errors in my code, i'm very new to C
void convert(void)
{
char line[80];
double input; //users input
char *endptr;
int valid = 0; //decides whether data is valid, this...
it still seems to ignore that and just asks for another value stating that invalid data was entered
when i compile, i get the error "convert() can not return a number"
I would like to get around this problem without changing code if I can, I am using Windows XP MCE
hey manutd, I gave that a try and if you type exit, nothing happens, it just proceeds to the Enter an amount to convert part.
this is the sort of method I was planning on using. so if anybody...
Hey, this is probably a simple thing to do. Basically, i'm doing a project for uni work. it is just a simple currency converter. I have managed to get the application so the data is checked and if...
hey, i got it to work using bits from the code by swoopy
thanks for all your help (and sorry I didn't reply till now)
:D
i thought it may have been because it's a float.
how would I use strtod? could you give me some sample code?
thanks
i am trying the following code within the convert function
void convert(void)
{
float input;
float output;
printf("Please enter an amount you wish to convert\n");
scanf("%f", &input);...
so could you help me validate the data to ensure it is a number?
i guess an if statement would be best although I don't know what to analyze data obtained from scanf.
I guess it would be an if...
that has worked perfectly
thanks for your help :D
Hey
I am currently in uni and I have just started to learn basic C. For a project, I have to make a simple application that can convert GBP into euros (roughly). The problem I have is displaying...