I have used this function many times but for some reason I am not getting what I expect. I am writing a parser program, everything is working well but when I tried to get the first lexeme (word or operator) the program kept returning { which was not in the input file, I then tried to use getline() and I got this as a result: {\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
Does anyone have any idea why this occurred?? I am using a mac and i was not sure if using an rtf file as my input file made a difference
Yeah an RTF file will contain more than just the text that you would see in an RTF editor. It'll contain all of the special codes for the formatting. This should be easy to figure out simply by looking at the RTF file within a plain text editor so that you can see the special codes and this will tell you exactly what will be read by the getline call.