我有以下方法内容:
FILE *file;
file = fopen("customers.dat", "w");
PList *list;
list = &customers;
fprintf(file, "%s", *(list->person.name));
fprintf 行给出的错误::
format '%s' expects argument of type 'char *', but argument 3 has type 'int' [-Wformat]
我有以下结构:
清单:
typedef struct PList{
Person person;
struct PList *nextPerson; // set to NULL by default <<<<<
}PList;
人:
typedef struct Person{
char name[100]; // Left as "" if empty Person
PersonID ID;
float amountOwed;
}Person;
个人编号:
typedef struct PersonID{
char letter;
int number; // 7 digits
}PersonID;