我真的不明白指针指针是如何工作的.没有使用指针指针的任何方式做同样的工作?
struct customer
{
char name[20];
char surname[20];
int code;
float money;
};
typedef struct customer customer;
void inserts(customer **tmp)
{
*tmp = (customer *)malloc(sizeof(customer));
puts("Give me a customer name, surname code and money");
scanf("%s %s %d %f", (*tmp)->name, (*tmp)->surname, &(*tmp)->code, &(*tmp)->money);
}
Run Code Online (Sandbox Code Playgroud)