... malloc(sizeof(struct abc));. 另一種寫法可以將程式碼簡化,將sizeof(struct abc)改成sizeof(*ptr),如下所示: struct abc *ptr = malloc(sizeof(*ptr));.
確定! 回上一頁