online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> using namespace std; void swap (int arr[] ,int a,int b) { int x; x=arr[a]; arr[a]=arr[b]; arr[b]=x; } void DSF ( int arr[],int n) {int low=0, mid=0 , high=n-1; for ( int i=0; mid<=high;i++ ) { if(arr[mid]==0) { swap(arr ,low,mid); low++; mid++; } else if (arr[mid]==1) {mid++;} else if ( arr[mid]==2) {swap(arr, mid,high); high-- ;} } return ; } int main() { int n; n=8; int arr[n]={1,1,0,2,0,1,2,0 } ; DSF(arr,n); for (int i=0; i<n;i++) {cout<<arr[i]<<" ";} return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue