Char array overwriting values C++
Posted on 2009-12-21
Im writing an application that uses a char* array. its formed using the following struct:
struct MqlStr // MQL String Array
this array is passed into a function from an external function, which is also where it originates.
the DLL im writing gets data from the server then assigns it to parts of the array. the problem i have is that the data is being over written.
for example, i get one value normally a long one and put into arr1.string using strcpy.
i then repeat with new data into arr1.string and arr1.string.
what i find is the value i put into arr1.string is now in all three, 40,30,and 20.