Can someone explain how pointer to pointer works?
- by user3549560
I don't really understand how the pointer to pointer works. Any way to do the same work without using pointer to pointer?
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);
}