0

I have a question:

Say I have a text file with a bunch of words on it, say the following:

hello
baby
crap
hate
ground
soul
fart
hot
render

Now, if I make a program that requires the user to input a word, how would I go about searching the text file and seeing if that word is there?

I haven't any code for this yet. I know how to open/close text files, as well as read from them and output their contents, but to search them...I dunno.

Help appreciated and thanks in advance.

4
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by hag++
0

Im a BSc IT student. would anyone help me on how to make and use a file stream in detail please. I am desparate since i have a test and an exam coming up in a couple of weeks.

0

Explaining how file streams work in detail is not going to be something that anybody here really wants to do. What you should do is study up on file IO (Using your book, interwebs etc.), write some test code and post it with any questions/ problems.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.