2
I have a problem, I have no idea how to fill this vector with some value, for example, I want to fill it all with -1 (start it all with -1). The problem here is that I don’t know exactly how big my vector is.
typedef struct argumentosThread {
int dim, queens, posicoes, total;
int *posicCertas;
int head;
}ArgumentosThread;
There in the middle of the code I initialize it, I put sizeof(int) because I don’t know what will be the size of the vector, it can be very small or so VERY large.
argumentos->posicCertas = malloc(sizeof(int));
You have to know somehow, there is no miracle. What you did is not create a vector, you are creating a single element, in this case you know the size, it is 1.
– Maniero
Which vector? If you’re talking about
argumentos->posicCertas
it is started as a pointer to an integer only and not a vector itself– Isac