Run Error is showing in compile message

This is my code. It is working fine on my local ide but showing a compile message of run error here. How can I resolve it? #include<bits/stdc++.h>
using namespace std;

void Tripletsum(int N,int arrays[],int key){
for(int i=0;i<N;i++){
int current=key-arrays[i];
int low=i+1;
int high=N-1;
while(low<high){
if(arrays[low]+arrays[high]==current){
cout<<arrays[i]<<", “<<arrays[low]<<” and "<<arrays[high]<<endl;
low++;
high–;
}
else if(arrays[low]+arrays[high]>current){
high–;
}
else{
low++;
}
}
}
}

int main() {
int n,arr[100], target;
cin>>n;
for(int i=0;i<n;i++){
cin>>arr[i];
}
cin>>target;
sort(arr,arr+n);
Tripletsum(n,arr,target);
return 0;
}

hello @agarwal_prachi

increase of array size.

always first read n (the size) and then use it to declare array.
like this->
int n;
cin>>n;
int arr[n];

Thankyou for resolving!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.