Copying Struct to a Pointer array in a function C
问题 i have a huge problem allocating memory in C i have this struct typedef struct{ int x; int y; }T; i want to create a function that dynamically adds a structs to a pointer. something like: int main() { T* t; f(&t); free(t); } up to this point i think everything is ok, now the function is where i get lost void f(T** t) { T t1; T t2; T t3; //first i malloc *t=malloc(sizeof(T)*T_MAX_SIZE);//i want another function to make the array bigger, but this is not as important as the problem t1.x=11; t1.y