To start things off, since you have an array of strings, not of characters, you have to declare it as char* array[19];
Then, you can declare the following (always useful) macro
#define ARR_SIZE(arr) ( sizeof((arr)) / sizeof((arr[0])) )
Last, you can choose arr[rand() % ARR_SIZE(arr)]
(while keeping in mind that performing %
on rand()
is not the proper way to do get a random number within a range.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…