Question related to array slicing

In reply to poonamnlwd:

It would really help others help you better if you posted the full actual error message instead of just saying “getting error”

There is one obvious syntax error in your call to shifting_function() inside the for-loop. The function definition requires 3 arguments, and it look like you are only passing 1 argument, and that argument “ref int m” is not the correct syntax.

You have a while(!$feof(file)) loop, but no other file I/O statements, so once in the loop, you would never get out.

The slice current_data[4:(2*m)-1 -: 2] has two “:” operators in it. Can you explain what parts of current_data you are expecting to select?