B-but i have deleted my message
I just want to emphasize the reason of why the second argument is not strictly necessary const. Here is the example:
void printArr_aaa(const int *arr, int n);
void printArr_bbb(const int *arr, const int n);
void fx(void)
{
const int n = 4;
const int arr[] = {1, 2, 3, 4};
printArr_aaa(arr, n);
printArr_bbb(arr, n);
}
Both calls work just fine. But...
void printArr_aaa(const int *arr, int n);
void printArr_bbb(int *arr, int n);
void fx(void)
{
const int n = 4;
const int arr[] = {1, 2, 3, 4};
printArr_aaa(arr, n);
// Error, can't accept (const int *)
printArr_bbb(arr, n);
}
So marking the second argument as const does not really change the situation. That's why it's not strictly necessary.