S
someone else
hello
i'm looking for good ways to resize a structure. for example:
typedef struct mystruct {
....
}
mystruct small[1024];
....
/*need to resize */
mystruct big[2048];
for(int i=0;i<1024;i++)
big = small;
....
is there a more efficiant way? this could be very ineficiant, since it
creates a new array, and then copies all the values from the old array, is
there a way to keep the old array, with its variables, and just add new
elements to it?
any suggestions would be appreciated
i'm looking for good ways to resize a structure. for example:
typedef struct mystruct {
....
}
mystruct small[1024];
....
/*need to resize */
mystruct big[2048];
for(int i=0;i<1024;i++)
big = small;
....
is there a more efficiant way? this could be very ineficiant, since it
creates a new array, and then copies all the values from the old array, is
there a way to keep the old array, with its variables, and just add new
elements to it?
any suggestions would be appreciated