Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #28373

Re: "\x1337\xcafe"?

From Nobody <nobody@nowhere.com>
Subject Re: "\x1337\xcafe"?
Date 2012-11-19 07:39 +0000
Message-Id <pan.2012.11.19.07.39.17.296000@nowhere.com>
Newsgroups comp.lang.c
References <86vcd284km.fsf@gray.siamics.net>
Organization Zen Internet

Show all headers | View raw


On Mon, 19 Nov 2012 13:55:21 +0700, Ivan Shmakov wrote:

> 	I wonder what do the specifications say on this matter?

6.4.4.4 (Character constants) p1:

	...

	escape-sequence:
		simple-escape-sequence
		octal-escape-sequence
		hexadecimal-escape-sequence
		universal-character-name

	...

	octal-escape-sequence:
		\ octal-digit
		\ octal-digit octal-digit
		\ octal-digit octal-digit octal-digit

	hexadecimal-escape-sequence:
		\x hexadecimal-digit
		hexadecimal-escape-sequence hexadecimal-digit

	...

6.4.5 (String Literals) p3:

	The same considerations apply to each element of the sequence in a
	character string literal or a wide string literal as if it were in an
	integer character constant or a wide character constant, except that the
	single-quote ' is representable either by itself or by the escape
	sequence \', but the double-quote " shall be represented by the escape
	sequence \"

Note the disparity between octal (which is limited to 3 digits) and
hexadecimal (which isn't limited).

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

"\x1337\xcafe"? Ivan Shmakov <oneingray@gmail.com> - 2012-11-19 13:55 +0700
  Re: "\x1337\xcafe"? Nobody <nobody@nowhere.com> - 2012-11-19 07:39 +0000
  Re: "\x1337\xcafe"? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-11-19 07:57 +0000
  Re: "\x1337\xcafe"? Keith Thompson <kst-u@mib.org> - 2012-11-19 00:07 -0800
    Re: "\x1337\xcafe"? "BartC" <bc@freeuk.com> - 2012-11-19 11:55 +0000
      Re: "\x1337\xcafe"? Ike Naar <ike@sverige.freeshell.org> - 2012-11-19 12:10 +0000
        Re: "\x1337\xcafe"? lawrence.jones@siemens.com - 2012-11-20 17:42 -0500
          Re: "\x1337\xcafe"? James Kuyper <jameskuyper@verizon.net> - 2012-11-20 18:29 -0500
    Re: "\x1337\xcafe"? Ivan Shmakov <oneingray@gmail.com> - 2012-11-19 20:08 +0700
    Re: "\x1337\xcafe"? Robert A Duff <bobduff@shell01.TheWorld.com> - 2012-11-23 19:52 -0500
      Re: "\x1337\xcafe"? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-11-24 02:34 +0000
      Re: "\x1337\xcafe"? James Kuyper <jameskuyper@verizon.net> - 2012-11-24 11:31 -0500
      Re: "\x1337\xcafe"? Keith Thompson <kst-u@mib.org> - 2012-11-24 12:08 -0800
  Re: "\x1337\xcafe"? BGB <cr88192@hotmail.com> - 2012-11-19 02:08 -0600
    Re: "\x1337\xcafe"? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-11-19 15:31 +0000
      Re: "\x1337\xcafe"? BGB <cr88192@hotmail.com> - 2012-11-19 11:54 -0600

csiph-web