In reply to Omkar:
The C prototype for your function is
void exp2_c(const int* arr);
Because the default argument direction is input, which means copy on entry. You want inout, and the C prototype becomes
void exp2_c(int* arr);
In reply to Omkar:
The C prototype for your function is
void exp2_c(const int* arr);
Because the default argument direction is input, which means copy on entry. You want inout, and the C prototype becomes
void exp2_c(int* arr);