0
Good morning! I’m having trouble passing a vector to void function for the sorting to be done and returned, as well, problem to pass to another void function whose purpose is to display the already organized vector.
Compiler returns this error:
Warning: Passing arument i of 'Ordenarvetor' 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?
The program did not break as it used to do but did not return me the organized vector
– Lelre Ferreira
I’m also having trouble organizing xD excuse
– Kira
A college colleague pointed out the error. I leave for consultation of anyone with similar doubts.
– Lelre Ferreira