#include <stdio.h>
void mami(int **p1, int **p2, int *b)
{
*p1 = b;
*p2 = b;
int y=*b, t=*b;
for(int i=0; i<4; i++)
{
if(y<*(b+1))
{
//printf("%d %d\n", y, t);
*p1 = (b+1);
y=*(b+1);
}
if(t>*(b+1))
{
t=*(b+1);
*p2 = (b+1);
//printf("%d %d\n", y, t);
}
b++;
// printf("%d %d\n", y, t);
}
}
int main() {
int * ma;
int * mi;
int a[5]={1, 2, 3, 4, 5};
mami(&ma, &mi, a);
printf("%p %p\n", ma, mi);
printf("%p %p\n", &a[4], &a[0]);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: