Having trouble with scanf function
Here are two functions for a simple program. I am trying to get information from the keyboard but for some reason the program does not take the info. In the Get_ballance function no matter what number is entered inD, and ballance ==0. For the Get_Trans function the program does not even pause for input and returns back to main.
Thanks in advance,
O'D
The rest of the file is attached in case you need to look at it.
/*------------------------------------------------------------------------------------------*/
void Get_Ballance (double *Ballance)
{
double inD=0; /*temp variable*/
printf("Enter the begining ballance: ");
scanf ("%f",&inD);
printf("%4.2f",inD);
*Ballance = inD;
/*test*/printf("\n Ballance = ");
printf("%4.2f",*Ballance);
printf("\n InD= ");
printf("%4.2f",inD);
}
/*-------------------------------------------------------------------------------------------*/
void Get_Trans (char *code,double *amount)
{
char inC;
double inD;
printf("\nChoose from the following options: ");
printf("\nEnter 'C' for a check. ");
printf("\nEnter 'D' for a deposit. ");
printf("\nEnter 'E' to end.");
scanf ("%c",&inC);
printf("\n code = ");
printf("%c",inC);
}