Trying to figure out how to get this program to work, its suppose to prompt the user for the data then list the users data but for some reason is not compiling properly.
#include <stdio.h>
typedef struct
{
int data;
char firstName[30];
char lastName[30];
char street[35];
char city[20];
char state[3];
int zip;
char phone[15];
int accountId;
} Customer[10];
void insert(Customer list[], int size );
void search(void);
int i = 0;
void main()
{
const int size = 2;
Customer list[size];
insert( list, size );
search( void );
}
char find_customer(void)
{
int i;
for (i = 0; i < Customer; i++)
if ( Customer[i].state == state )
return i;
return -1;
}
void insert(Customer list[], int size )
{
printf("Please enter the Customer information:\n");
for(i = 0; i < 2 ;i++)
{
printf("\Enter Data for Customer:");
scanf("%S",&list[i].data);
printf("\Enter First Last Phoner:");
scanf("%S %S %S",&list[i].firstName, &list[i].lastName,&list[i].phone);
printf("\Enter Address (Street City State ZIP):");
scanf("%S %S %S %U ",&list[i].street, &list[i].city, &list[i].state, &list[i].zip );
}
}
void search(void)
{
int i, state;
printf(" Enter a state: ");
scanf("%S", &state);
i = find_customer(state);
if (i >= 0) {
printf(" name: %s\n", Customer[i].firstname);
}