I desire that my programm makes the user input numbers into a dynamic array and if the user type -1, it will stop asking for more numbers. The problem here is probably the condition in my while, that's where I have my doubts.
int i=0, size=0;
float *v;
printf("Write a group of real numbers. Write -1 if you want to stop writing numbers\n");
v=(float*)malloc(size*sizeof(float));
while(v!=-1)
{
printf("Write a number\n");
scanf("%f", &v[i]);
i++;
size++;
v=realloc(v, (size)*sizeof(float));
}