Good morning! I'm having trouble passing a vector to void function so that the ordering is done and returned, as well as problem to pass to another void function whose purpose is to display the already organized vector.
The compiler returns this error:
warning: passing arument i of 'OrderVetor' makes pointer from integer without a cast warning: passing arument i of 'ExibiVetor' makes pointer from integer without a cast
#include<stdio.h>
#include<stdlib.h>
#include<locale.h>
void OrdernarVetor(int *vetorN, int tamanho)
{
int i, j;
int aux;
for(i = 0; i < 5; i++)
{
for(j = 0; j < 5; j++)
{
if(vetorN[i] > vetorN[j])
{
aux = vetorN[i];
vetorN[i] = vetorN[j];
vetorN[j] = aux;
}
}
}
}
void ExibirVetor(int *vetorN, tamanho)
{
int i;
for(i = 0; i < 5; i++)
{
printf("%i", vetorN[i];)
}
}
int main(void)
{
setlocale(LC_ALL, "");
int i;
int vetorN[5];
for(i = 0; i < 5; i++)
{
printf("Insira valor da posição [%i]", i);
scanf("%i", &vetorN[i]);
}
OrdernarVetor(*vetorN, 5); ExibirVetor();
}
What am I doing wrong?