i am getting a segmentation fault at line 12. when i tried to print temp, it went in infinite loop. can you tell me the reason behind this and how to correct it(si-starting index, ei - end index)
using namespace std;
void partition(int arr,int si,int ei)
int i,count=0, temp;
int index = count ;
temp= arr[si]; // here is the error
cout<<temp<< " ";
Use the debugger to trace through the code monitoring variable values so that you see what is happening during the code execution. When you find where the code is not executing as expected, then you have found a problem. Being able to use the debugger to find run-time problems in code is a skill that all programmers need to acquire. The sooner the better.