This looks like it is a school assignment of some sort. I won't solve it for you but I will give you some pointers.
1. First of all, the rand() function is going to return an integer. Not a string. Remember that a string is a set of characters.
2. Because of #1, you will need to generate your string one character at a time. So your randstr function will need to have a loop in it to do this. If you wish, you may also pick the length of the string at random.... not sure if that's what you want.
3. Remember that as directed by line 31, your random number will be divided by 91 and the remainder will be added to 65... so only use 91 if you want the character to be ANY of the 91 characters in the ASCII table after 65. (65 is A)
4. Are you looking to assign the string to a variable upon return from the function?
5. You will get the same string every time if you don't seed the random number generator with the current time first.
Okay i believe I got it. But please, if you can, check back in the next 24 hours if i have any questions about this. Yes it is a school assignment haha. Thanks a lot.