By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,142 Members | 1,907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,142 IT Pros & Developers. It's quick & easy.

representation of an escape sequence

P: n/a
N869 [5.2.2]

" Each of these escape sequences shall produce a unique
implementation-defined value which can be stored in a
single char object. The external representations in a text file
need not be identical to the internal representations."

What do we mean by external and internal representation of
escape sequences in a text file ?

Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 7 Jul 2005 21:37:02 -0700, ju**********@yahoo.co.in wrote:
N869 [5.2.2]

" Each of these escape sequences shall produce a unique
implementation-defined value which can be stored in a
single char object. The external representations in a text file
need not be identical to the internal representations."

What do we mean by external and internal representation of
escape sequences in a text file ?


Consider the '\n' character in Windows. In your program, it produces
a char with the value 0x0a. When it is written to a text file, it
magically becomes a two character value 0x0a0d.
<<Remove the del for email>>
Nov 15 '05 #2

P: n/a
On 7 Jul 2005 21:37:02 -0700, ju**********@yahoo.co.in wrote:
N869 [5.2.2]

" Each of these escape sequences shall produce a unique
implementation-defined value which can be stored in a
single char object. The external representations in a text file
need not be identical to the internal representations."

What do we mean by external and internal representation of
escape sequences in a text file ?


Note that the wording is for external representations in a text file,
not internal representations which by definition aren't in any file.
But it isn't clear whether this refers to representations of the
(character) value generated by the escape sequence, in which case the
reference to text file is correct but may be incomplete because binary
files must have a reversible single-byte (at least as far as fseek()
is concerned) representation for every unsigned char value but AFAICS
it doesn't have to be an identity; or whether this refers to
representations of the escape sequence, in which case it actually
should say _source_ file because the standard is elsewhere careful not
to require that source files _be_ text files, although they must
behave similarly in quite a few respects, and (thus) usually are.

- David.Thompson1 at worldnet.att.net
Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.