representation of an escape sequence

J

junky_fellow

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 ?
 
B

Barry Schwarz

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>>
 
D

Dave Thompson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top