I'm trying to write a program that creates a sentence by selecting random words stored in 4 arrays of pointers. Sometimes the program will work and sometimes it will crash or display gibberish. Can anyone lend a hand?
You're accessing out of your array bounds sometimes. The arrays are of size 5, which are accessed using 0-4. You're using 5 sometimes though which is out of bounds.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.