In another post link text
I am trying to do the same thing with a struct, but I have a problem with my sizeof operator, so in the integer case, I did this:
size_t totalMem = rows * sizeof(int *) + rows * cols * sizeof(int));
And in the struct case I did this:
size_t totalMem = (rows * sizeof(struct TEST *)) + (rows * cols * sizeof(struct TEST));
But I get the error: Invalid application of sizeof to incomplete type of struct TEST.
Any thoughts? Thanks.