I'm getting a the error "passing arg1 of 'strcpy' makes pointer from integer without a cast....
#include<stdio.h>
#include <stdlib.h>
struct node {
char make;
char model;
int year;
char color;
char plate;
struct node* next;
};
void menu();
void insert(struct node** head, char make, char , int, char, char);
int main(void){
struct node* head = NULL;
char make, model,plate,sfname,fname,color;
int x,year;
menu();
scanf("%d",&x);
switch(x){
case 1:
printf("Enter make: ");
scanf("%s",&make);
printf("Enter model: ");
scanf("%s",&model);
printf("Enter year: ");
scanf("%d", &year);
printf("Enter color: ");
scanf("%s", &color);
printf("Enter license plate number");
scanf("%s",&plate);
insert(&head,make,model,year,color,plate);
break;
case 2: printf("Enter the license plate number of the vehicle to remove");
scanf("%s ", &plate);
//del();
break;
case 3: printf("Here are all vehicles:\n");
//printcars();
break;
case 4: printf("Enter a filename to save as ");
scanf("%s ",&sfname);
//savetfile();
break;
case 5: printf("Enter filename to load ");
scanf("%s ",&fname);
break;
case 0: printf("Thank you using this program!");
break;
default: "Not an options";
}
system("PAUSE");
return 0;
}
void insert(struct node** head, char make,char model, int year, char color, char plate){
struct node* newnode;
struct node* crnt;
newnode = (struct person*)malloc(sizeof(struct node));
strcpy(make,newnode->make);
strcpy(model,newnode->model);
//newnode->year = year;
strcpy(color, newnode->color);
strcpy(plate, newnode->plate);
newnode->next = crnt->next;
crnt->next = newnode;
}
void menu(){
printf("Here are your options:\n1) Insert a vehicle\n2) Delete a vehicle\n3) Print all vehicles\n4) Save to file\n5) Load from file\n0) Quit\n");
}