hi guys, this is 1 function im making as part of a program, it ahs to display info by letting the user input either an account number or account name and i originally started out with 10 errors but ive managed to half them, i jus cant sem to fix these ones....help would be very much appreciated, i only posted the code needed cos my code is 700 lines long, all of the functions are declared so ive no errors with them, here are the errors and code, i have highlited the errors with ************ i only have 1 error left now i managed to fix 4 of them and the error is the int display menu choice line,
Code:
void display_customer_details_name_accountno(CUSTOMER person_array)
int diplay_menu_choice *******************************************************************************
do
{
display_menu_choice = menu();
switch ( display_menu_choice )
{
case 1: display_by_account_number(persons);
break;
case 2: display_by_name(persons);
break;
}
}
while ( menu_choice != 0)
return 0
/*------------------------------------------------------------------------------------/
| Function: Display By Account Number Or Name |
| |
| Purpose: Display Information |
| |
| |
|--------------------------------------------------------------------------------------*/
int display_menu(void)
{
int choice
printf(" Please Choose 1 Of The Following\n");
printf(" 1. Display By Account Number\n");
printf(" 2. Display By Name And Surname\n");
printf(" 0. Return To Menu\n");
do
{
scanf("%d",&choice); /* when the choice is entered it is taken in and the corresponding function is done according to which number was pressed */
fflush(stdin);
} while( choice < 0 || choice > 2 );
return (choice);
}
void display_by_account_number( CUSTOMER person_array[] )
{
int CUSTOMER_number;
int pos;
/* Get The Customer Number */
printf(" Customer Number To Display ( 1-4 Digits, Except 0) :");
do
scanf("%4d",&CUSTOMER_number);
while( CUSTOMER_number <= 0);
/* Find The Customer In The Database */
pos = search_database( person_array,CUSTOMER_number);
/* Does The Customer Exist In The Databse */
if ( pos == MAX_PERSONS) /* No */
printf(" The Selected Customer Is Not In The Databse\n" );
else /* Yes - Display The Details */
display_customer_details(&person_array[pos]);
}
void display_by_name(CUSTOMER*ptr)
{
char acc_name[50];
printf("\nEnter the account holder's name: ");
get_name(acc_name);
if(acc_name[0] == '\0') return;
if(!name_check(acc_name))
{
printf("\nThat name does not exist!\n");
return;}
{
printf("\n\n");
printf("Account number : %d\n",ptr->number);
printf("Surname : %s\n",ptr->surname);
printf("Firstname : %s\n",ptr->first_name);
printf("Occupation : %s\n",ptr->occupation);
printf("Surname : %s\n",ptr->surname);
printf("Date of Birth : %2d/%2d/%2d\n",ptr->dob.day, ptr->dob.month, ptr->dob.year);
printf("Address House Number : %s\n",ptr->ADDRESS.house_number);
printf("Address Street : %s\n",ptr->ADDRESS.street);
printf("Address Area : %s\n",ptr->ADDRESS.city);
printf("Address County : %s\n",ptr->ADDRESS.county);
}
/*Function get name*/
void get_name(char *name)
{
int count;
char temp;
count=0;
while ((temp = getch()) != 13)
{
if(((temp > 64) && (temp < 91)) || ((temp > 96) && (temp < 123))||(temp == 32))
{
putchar(temp);
name[count]=temp;
count++;
}
if((temp == 8)&&(count > 0))
{
putchar(temp);
putchar(32);
putchar(temp);
count--;
}
}
name[count]='\0';
}
/*Function name_check*/
int name_check(char *customer)
{
int count;
for (count=0 ; count < number ; count++)
{
if (!strcmp(customer,account[count].name))
{
current = count;
return(1);
}
}
return(0);
};
[code] Error E2141 customerdisplay.c 595: Declaration syntax error