I created a vector of size defined by a constant, and when calling a function that returns an integer vector, this error is generated:
Incompatible types when assigning to type 'int * []' from type 'int'
The signature of the function is this below. The purpose is to assign the return from one vector to another.
#include <stdlib.h>
#include <stdio.h>
#define TAM 50
int main(int argc, char **argv)
{
int *V_VALORES_GERADOS[TAM];
int *VETOR_ORDENADO[TAM];
int *VETOR_VALORES[TAM];
int *V_FREQ_SIMP_ABS[TAM];
float *V_FREQ_SIMP_REL[TAM];
int *V_FREQ_ACUM_ABS[TAM];
float *V_FREQ_SIMP_ACUM[TAM];
V_VALORES_GERADOS = Gerar_Vetor(6); //ERRO AQUI(PRIMEIRA INSTRUÇÃO DA MAIN)
}
int *Gerar_Vetor(int FATOR){
int x;
int * VALORES = (int *) calloc (TAM, sizeof (int));
//Gera os valores e os armazena em um vetor.
for (x = 1;x <= TAM; x++) {
VALORES[x] = rand() % FATOR + 1;
}
if (VALORES == NULL)
return (NULL);
else
return VALORES;
}