ok here's the code now, and the errors that are with it:
Code:
#include <stdio.h>
#include <string.h>
#include <ctype.h>
typedef struct{
long id;
float quota;
float sales_credit;
} Salesperson;
typedef struct{
char trim[3];
char color[21];
float retail;
float invoice;
} Car;
typedef struct{
char name[21];
int in_stock;
Car cars[10];
} Model;
typedef struct{
char name[21];
int num_cars;
int num_people;
Model quantity[4];
Salesperson employees[8];
} Dealer;
void init_dealers(Dealer *d);
void stock_car();
void hire_salesperson();
void sell_car();
void find_car();
void car_match();
void deliver_car();
void print_report();
main()
{
int i;
Dealer dealers[10];
init_dealers(dealers);
for(i=0; i<10; i++)
printf("%s", dealers.name);
return 0;
}
void init_dealers(Dealer *d)
{
int end=1;
while(end)
{
scanf("%s", &d->name);
dealer++;
if(!strcmp(d->name, "####"))
end=0;
}
}
Code:
cc: Error: p7.c, line 60: In this statement, "dealers" has a pointer type, but occur
s in a context that requires a union or struct. (needstruct)
printf("%s", dealers.name);
-----------------------------^
cc: Error: p7.c, line 71: In this statement, "dealer" is not declared. (undeclared)
dealer++;
----------------^
what is going on here? and what am i missing?