+ 2
Is it possible for both the "rand() and srand()" functions to output string and any other datatype apart from int??
I made an array of codes in string so i could mix the strings around. I'm not sure how to write the code for this description, I wanted to know first if it was possible. But here's my code https://code.sololearn.com/cA12a19a237A/?ref=app
5 Antworten
+ 3
You could generate random numbers and use them as index for accessing the string array.
https://code.sololearn.com/c8CvADr7h3wA/?ref=app
+ 2
ataladin 87
I have updated the above mentioned code. Now you can write something whenever only a city comes up. And if a specific city is randomly selected you will get an additional information about it. Furthermore happy coding.
+ 1
ataladin 87
in addition
You could for example code a second array with the information about each city, where the items have the same indexes as citys in them array.