Reading from a file and storing in array

后端 未结 4 609
刺人心
刺人心 2020-12-09 01:00

I\'ve written the following program to read line by line from a file and store it in the words array. The output should be two random words from the array. But surprisingly

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-09 01:18

    Did you initialize the random number generator with srand? An explanation, with an example of how to use it is available here.

提交回复
热议问题