Could someone please help me?

Given a text file that is syntactically correct C + + program text.
Count how many assignment operators (=, + =, * = - =, / =,% =) contains given program.
You may believe that the program is not in the text and comments that the characters will not appear in the text literals.
Do not add comparison operators (==,! = Etc..).
Do not back up the entire contents of the file in memory.

I'm not asking for entire code. I'm just don't know how exactly to do this because I cant read entire file or row. I have to read from the file by one symbol.. ://
Read to first two characters, say f and s. If s is '=' and f is not '=','!','<','>' then you have an assignment operator. Read next character, t, then assign f=s, s=t, and repeat the procedure. When you read the t character, you might want to ignore spaces, tabs, and new lines
Topic archived. No new replies allowed.