man*_*her 1 c printf types arguments
我有以下方法内容:
FILE *file;
file = fopen("customers.dat", "w");
PList *list;
list = &customers;
fprintf(file, "%s", *(list->person.name));
Run Code Online (Sandbox Code Playgroud)
fprintf行给出的错误::
format '%s' expects argument of type 'char *', but argument 3 has type 'int' [-Wformat]
Run Code Online (Sandbox Code Playgroud)
我有以下结构:
plist中:
typedef struct PList{
Person person;
struct PList *nextPerson; // set to NULL by default <<<<<
}PList;
Run Code Online (Sandbox Code Playgroud)
人:
typedef struct Person{
char name[100]; // Left as "" if empty Person
PersonID ID;
float amountOwed;
}Person;
Run Code Online (Sandbox Code Playgroud)
是PersonID:
typedef struct PersonID{
char letter;
int number; // 7 digits
}PersonID;
Run Code Online (Sandbox Code Playgroud)