Skip to content

Instantly share code, notes, and snippets.

@pasali
Created November 23, 2011 15:10
Show Gist options
  • Save pasali/1388914 to your computer and use it in GitHub Desktop.
Save pasali/1388914 to your computer and use it in GitHub Desktop.
#include<stdio.h>
#include<string.h>
void bol(int *p, int pivot)
{
char a[50];
char b[50];
int i = 0,j = 0;
while( *p != '\0' )
{
if (*p < pivot)
{
a[j] = *p;
j++;
}
else if (*p > pivot)
{
b[i] = *p;
i++;
}
p++;
}
a[strlen(a)-1] = pivot;
char *x =b;
while(*x != '\0')
{
a[j] = *x;
x++;
j++;
}
char *t = a;
while( *t != '\0')
{
printf("%d\n", *t);
t++;
}
}
int main()
{
int dizi[] = {1,2,34,23,5,41,78};
bol(dizi,23);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment