I do not believe that you could demension an array in the middle of your code and have it be dynamic at runtime.
I believe that variables and arrays are defined and created by the compiler.

But I could be wrong?

Can you not just make your array sufficiently large to be ready for the largest number of books you expect to have?