Target Sum-pair Challenge Compile Error

include< iostream >
include < bits/stdc++.h >

using namespace std;
int main() {
int n = 0, target = 0,cs = 0;
cin >> n;
int a[n] = {0};
for(int h = 0; h<n;h++){
cin>>a[h];
}
int k = sizeof(a)/sizeof(a[0]);
sort(a, a+k);
int i = 0;
int j = sizeof(a)/sizeof(int) - 1;
cin >> target;
while(i < j){
int cs = a[i] + a[j];
if(cs > target){
j–;
}
else if(cs < target){
i++;
}
else if(cs == target){
cout << a[i] << “and” << a[j] << endl;
i++;
j–;
}
}
return 0;
}

my code is right but in your CB compiler target sum-pair challenge i got error compile error
Please help me

my code is right but in your CB compiler target sum-pair challenge i got error compile error Please help me

i got an error in challenges modules in online.codingblocks.com not in cb.lk/ide

@be.rajshah hey ap ek bar code me k and j ko thek kro and use array size function of stl in place of that ,aur kbhi kabhar compiler me bhi problem askti hai but don’t worry your logic is correct ,I have seen it.