Working with structures is fine and you read text files like in this reading a textfile line for line
example is shown.
Be sure that you provide enough memory for the read text. If you know its maximal length you can use some static buffer else you need to malloc it. Dont ferget to free it.
Use the random
function like here shown.
On further question show always
the written code.