1. ## pointers exercise

Have to make a program that given an array of 7 integer from input, applies a function like this one:
void firstlasteven(int arr[], int dim, int* firstocc, int* lastocc);
that returns the position of the first and last even number or "-1" if there's none.
example input/output:

3 1 5
6
4
8
8
-8
1

This is my code so far:
Code:
```#include <stdio.h>

int *primoultimopari(int arr[], int dim, int* primaocc, int* ultimaocc){
int i;
int s=0;
for(i=0;i<dim;i++){
if((arr[i]%2)==0){
if(s==0){
*primaocc=i;
s++;
}
else{
*ultimaocc=i;
}
}
}
}

int main(void){
int dimensione=7;
int i;
int A[7];
for(i=0;i<7;i++){
scanf("%d", &A[i]);
}
int prima,ultima;
primoultimopari(A[7], dimensione, &prima, &ultima);
printf("%d %d", prima,ultima);
return 0;
}```
(prima is first, ultima is last.)

Any help would be much appreciated.
These are the errors i get:

Code:
```Lez6Es4c72.c:28:21: warning: passing argument 1 of ‘primoultimopari’ makes pointer from integer without a cast [-Wint-conversion]
primoultimopari(A[7], dimensione, &prima, &ultima);

Lez6Es4c72.c:4:6: note: expected ‘int *’ but argument is of type ‘int’
int *primoultimopari(int arr[], int dim, int* primaocc, int* ultimaocc){
^~~~~~~~~~~~~~~```

2. this might help...

Code:
```#include <stdio.h>

void primoultimopari(char list[], int dimensione, int *prima, int *ultima) {
*prima = -1;
*ultima = -1;
for (int i=0; i<dimensione; i++) {
if ( list[i] % 2 ) {
if (*prima > 0) *ultima = i;
if (*prima < 0) *prima = i;
}
}
}

int main(void){
int dimensione = 7;
int prima, ultima;
char list[dimensione];

primoultimopari( list, dimensione, &prima, &ultima );

printf( "%i %i", prima, ultima );
return 0;
}```