Thanks RuggedCircuits, but I had already tried that. Although the program would compile, it seems that it isn't working properly. When I try "sizeof(vectorV)", it always returns 2, no matter what the argument to malloc is. Loking up on the internet, I found this:
int *ptr;
ptr = malloc(10 * sizeof (int)); // Without a cast
ptr = (int*)malloc(10 * sizeof (int)); // With a cast
"Adding the cast may mask failure to include the header stdlib.h, in which the prototype for malloc is found."
http://en.wikipedia.org/wiki/MallocI'm not sure that really is the problem, but even if it is, I undestood from other topics tha the stdlib.h is already included in any arduino program and I dont know how to fix it.
PS: I tried using "#include <stdlib.h>" at the beginning of the code, but it didn't make any difference.