c++ memory initialization for passed arguments
<p>I am writng a c++ program. I am parsing a file and initializing a structure. I have an array to initialize but I have to read the size of the array from the file. I want the array length read and array initialization in one function. If I pass the array pointer to another function and do a new, when the function returns, the pointer is destroyed, and I cannot see the initialized values. Is this expected or am I missing something. How can I overcome this problem?</p>
