小编acc*_*511的帖子

有人可以解释指针指针的工作原理吗?

我真的不明白指针指针是如何工作的.没有使用指针指针的任何方式做同样的工作?

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)

c malloc struct pointers

2
推荐指数
1
解决办法
227
查看次数

标签 统计

c ×1

malloc ×1

pointers ×1

struct ×1