I am trying to debug a simple c++ program, which takes some inputs at the runtime. When i start debugging, it just stops where I should input the values. But after that it does not run. When i click on resume, still it does not. Can someone help me how can i get this debugged. Thank you so much.
#include "iostream"
using namespace std;
void selection_sort(int *a, int n){
int i,j,temp,pos,smallest;
for (i=0; i<n; i++){ ### i have a debug point here
smallest = a[i];
for(j=i; j<n; j++){
if(smallest > a[j]){
smallest = a[j];
pos = j;
}
}
temp = a[i];
a[i]=smallest;
a[pos] = temp;
}
}
int main(){
int arr[10],i;
for (i=0;i<10;i++) ## the eclipse debugger i.e. gdb stops here, as I have to input some values
cin >> arr[i];
selection_sort(arr,10);
cout << "\nafter sorting:\n";
for (i=0;i<10;i++)
cout << arr[i] << " ";
return 0;
}
`