weird glitch in program involving fstream

I don't understand it and I will try my best to explain it. I have a program that reads a text file with <fstream>. In my program I iterate through each character that is in the text file and I store it into a char*. I then pass this char * into a function. This function will go through each character and look for something (unimportant).

Now the thing I don't understand is that in the function, it can iterate through the characters fine until you hit a part in the text file that has a comment (//).

I've been debugging for awhile and I've narrowed it down to this. It might be something else though because this doesn't make any sense. I can show you my program if you need it.

Last edited on
You must be iterating through the characters incorrectly.

Either that or you did not read the characters from the file correctly.
Last edited on
I iterate through them with other text files and it works fine. Idk its confusing me and I've been stumped. Can I private message you my program and you take a look?
I don't like to answer Qs in PM. If you can't post it publicly then I don't think I can help.
Topic archived. No new replies allowed.