> fgets(line, 500, stdin);
> sscanf(line, "%s", loan_amount);
> printf("\n");
Yes, you probably need some kind of numeric data types for these (the rest seem fine as strings).
So perhaps the parameter would be
double *loan_amount
And to convert it
sscanf( line, "%lf", loan_amount );
You should check the return result of sscanf, and in particular, check that the %s conversions really will fit into the intended strings.
> char last_name[26], first_name[26], address[26], city_state[26];
> char phone_number[9], account_number[9], loan_amount[9], apr[9],
> loan_term[9];
> information (&*account_number, &*last_name, &*first_name, &*address,
> &*city_state, &*phone_number, &*loan_amount, &*apr, &*loan_term);
Too many & and *
Say you want the first 6 as strings, and the last 3 as doubles.
Code:
char last_name[26], first_name[26], address[26], city_state[26];
char phone_number[9], account_number[9],
double loan_amount, apr, loan_term;
information (account_number, last_name, first_name, address,
city_state, phone_number, &loan_amount, &apr, &loan_term);
You only need the array name to pass an array to a function. The "&*" is the same, but they just cancel each other out.
The prototype for the function being
Code:
void information(char *account_number, char *last_name, char *first_name,
char *address, char *city_state, char *phone_number, double *loan_amount,
double *apr, double *loan_term)