There is a function that returns a pointer to a double array. I want to convert it to a pointer that points to an integer array because all the data that the function returns will be integers and I want to save memory.
I tried to type cast it, but the problem is that the location of the consecutive elements are 8 bytes away because the function returns a pointer to a double. So even if I type cast the pointer the location of each element will not change.
Is there a way for me to do this?
I am trying to avoid having to copy one array to another array because I shall be using a large amount of data. But if it comes to that is there an efficient method to copy from a double* to an array to an int* to an array?
Thanks
I tried to type cast it, but the problem is that the location of the consecutive elements are 8 bytes away because the function returns a pointer to a double. So even if I type cast the pointer the location of each element will not change.
Is there a way for me to do this?
I am trying to avoid having to copy one array to another array because I shall be using a large amount of data. But if it comes to that is there an efficient method to copy from a double* to an array to an int* to an array?
Thanks