Archived

This topic is now archived and is closed to further replies.

File Lines

This topic is 5534 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m just curious, are ASCII file lines treated the same way was strings?(character arrays). What I mean is, well, in ASCII files you can use quotes "", whereas in strings you have to "escape" them (\") So, does the fstream do something to deal with it, or is just the file lines aren''t treated the same way strings are? I''m guessing its probably the former. I''m having a hard time finding good information on the inner workings of some things.

Share this post


Link to post
Share on other sites
quote:
Original post by Xanth
...whereas in strings you have to "escape" them (\")

Correction: in C-like strings you have to escape them. The escape character technique is used to suspend normal processing within the string (without escaping, the double quote character would represent the end of the string. After C has successfuly processed the string, the internal representation is identical to the ASCII representation (so long as you''re talking about null-terminated char arrays; things change with MBCS and UNICODE).

quote:

So, does the fstream do something to deal with it, or is just the file lines aren''t treated the same way strings are?

"Strings" and "lines" aren''t synonymous concepts. Technically, an ASCII file is just one big string that contains a bunch of newline (and sometimes carriage-return) characters somewhere in the mix.

Share this post


Link to post
Share on other sites