There are many strings
When I print it out like this, I want to press refresh number 6, and I want to make a random string, so what function should I use? It's an example from a book, but I can't solve this TT
c++
Run the rand() function to obtain a random value.
Usually, before you use the rand() function, you run a function that sets a seed value called srand(), but if you search for the rand() function, you'll find many examples.
You can pre-declare multiple strings as a string array, get random numbers, index the array, and get the string.
http://www.cplusplus.com/reference/cstdlib/rand/
© 2024 OneMinuteCode. All rights reserved.