I have a variable **foo which I let user to initialize to foo[x][y]. Now, the problem is that how to change that size in the fly so, in example, when I first have foo[10][10] I would later have foo[100][100]. I could of course use another variable for swapping but I'm thinking of sizes like foo[10000][10000] so that would be a real memory eater (though, even without the temporary variable).
I've been thinking of linked lists, but that would be slow and still eats lots of memory. Any ideas?