1. ( The fix ). You pass books( an array of strings ) to a function accepting ( int, int ). You're passing ( string, int ).
2. Your for-loop in the function runs out of bounds of the array! count <= length. Length = 32, the array indices are 0-31.
3. You don't actually save the return of the function, so why not make it void. Then no return is necessary. Not really a problem, more of a "Cleaner code" option.