Basically, I have three arrays: CQueue (2D array), PQueue (2D array, the same number of arrays as CQueue, but with each array containing twice as many values) and CC (standard array, which equals long as an array in CQueue). I want to achieve a specific array in CQueue by copying it so that CC reads exactly the same as CQueue, and so that the first half of the equivalent array in PQueue also reads the same.
I was advised to use memcpy as a friend who seemed fine but didn't fix the problem. I don't know if there is a problem in me, potentially using memcpy incorrectly or if there is another problem. The following is a simplified version of the corresponding piece of code.
int (main) { int CQueue[numberOfArrays][halfSize] int PQueue[numberOfArrays][size] int CC[halfSize] for (i = 0; i < numberOfArrays]; i++) { memcpy (CC, CQueue[i], halfSize) memcpy (PQueue[i], CQueue[i], size) } }
Any help offered would be greatly appreciated, thanks!
source share