OK, I will retype it here in red, not to overlook it in the rest of the discussion.
TempPath is an array, which just means that it's a pointer irrevocably* attached to a chunk of memory.
getTempFileName returns pointer
Is wrong because I try to replace* pointer of array TempPath with a pointer from the getTempFileName return.
*TempPath already has its own chunk of memory that it cannot be separated from (since you declared it as an array). So compiler does not allow to copy the array pointer to another variable.
In other words. If compiler would allow to copy the pointer from one variable to the "already declared pointer with a chunk" so the original chunk of memory would be lost, would be a leak! So this block would be taken but there would be no link to it... So every chunk of memory which is reserved have to have 1 pointer which is not possible to separate from it.
TempPath is an array, which just means that it's a pointer irrevocably* attached to a chunk of memory.
getTempFileName returns pointer
Code:
TempPath = getTempFileName("scendata.tmp");
*TempPath already has its own chunk of memory that it cannot be separated from (since you declared it as an array). So compiler does not allow to copy the array pointer to another variable.
In other words. If compiler would allow to copy the pointer from one variable to the "already declared pointer with a chunk" so the original chunk of memory would be lost, would be a leak! So this block would be taken but there would be no link to it... So every chunk of memory which is reserved have to have 1 pointer which is not possible to separate from it.
Last edited: