My name is Michal and I live in Poland. Iíve found this forum while trying to get the information on how to reallocate a 2-d array and Iíve come across a thread which was concerned over 6 years ago on this forums. I hope you forgive me for coming back to it but I found there something which I find quite strange.
The link is: How to Realloc 2-D array
My question concerns the last post (by Salem) in this thread who wrote it in response to a piece of code posted by wots-guge in the post right above it. Salem wrote that there was a mistake in this code as the temp pointer ďK2Ē, used to secure the outcome of realloc functions, points to the same locating that ďK1Ē is pointing and therefore the posterís ďeffort to avoid stamping on the old pointer failsĒ. I hope you can find that.
My question is: Is it really a mistake? As I see it, even if two pointers (in this case ĎK1í and ĎK2í) point to the same location and the latterís value is changed it doesnít affect the former nor the location to which it points, therefore there is no problem using the same temp pointer a couple of times in order to assume the result of realloc functions.
Am I right or am I mixing something? Please, tell me if I donít understand something and. I hope you donít mind my refreshing a long forgotten thread but this issue really bothers me.
Thanks you, Michal