I am trying to move the float array ptr 256 “units” from the start so (256 * 4 bytes) for floats.
I am receiving a compile time error.
long new_capture_length = 4096;
long step_size = 256;
float data[new_capture_length];
data+=step_size;
error: invalid operands to binary + (have ‘float[(long unsigned int)(new_capture_length)]’ and ‘float *’)
How can I achieve this?
You cannot “move” an array. You can move a pointer into an array, for example:
But the location of
dataitself can never be altered, since it is not a pointer.I gave a somewhat more detailed answer to a very similar question recently: C Pointer Question (I don’t like to call “what’s wrong with this code” type questions exact duplicates even if they have the same underlying problem).