How can I read a file.txt in a list/forward_list

Need this for exam !
I don't think that there was a request to actually write code. More like the OP needs to know features of certain constructs. To acquire that knowledge, the OP has to read. Either what we write or what someone else has written.

Lets go for option 2 and point to:
Registered users can post here. Sign in or register to post.