-
Scanning a text file.
I have a project I need to do in which I need to look at a file, scan it, and show any occurances of C++ operators or variables. Like finding how many times int is shown.
The only help I'm looking for is could someone point me to, or show me, how I would scan a text file character by character and check it? There's a lot more to the project, but I can do that on my own. This is the part I'm stuck on.
Thanks in advance.
-
Also, how would I get a string input of word?
I know how to compare it, but how would I get the input of it?
Example is I find the word "dog" in the text file, and I want to compare it to a table or whatever of words, and match it with "dog" and mark an occurance of it. Basically like what a find function does.
-
Well, after tinkering with it, I got it to scan and print out the text file just fine. But I'd still like to know how to scan words at a time rather than just comparing character by character.
I'd like to know how to stop scanning after a return or space, put what I've scanned into a buffer, then compare. Is there a easier way to do this than just manually pounding out code?
Thanks.
-
Continuing this line of thought........ is there any support available in C/C++ for regular expressions?
Almosthere