freelanceprogrammers.org Forum Index » C

Re: QUERRY about two-character punctuation tokens, called di


View user's profile Post To page top
shabble Posted: Wed Jan 19, 2005 11:20 pm


Joined: 29 Dec 2004

Posts: 31
Re: QUERRY about two-character punctuation tokens, called di
From: Ashish Gupta [mailto:ashish_gupta_cal@...]

>Hi,
> C++ also recognizes two-character punctuation
>tokens, called digraphs. The digraphs and their
>equivalent tokens are:
>
> <: [
> :> ]
> <% {
> %> }
> %: #
> %:%: ##

These are actually called punctuators in ISO/IEC 9899:1999 (it uses the
term digraph in "quotes" in a footnote).

There also exist trigraphs:

??= #
??( [
??/
??) ]
??` ^
??< {
??! |
??> }
??- ~


>The following program is valid in both C99 and C++:

[snip]

> My question is what is the need of such digraphs?

Because while ISO/IEC 9899:1999 requires that (among others) the
following characters `exist` in the "source character set" and
"execution character set":

! " # % & ` ( ) * + , - . / :

; < = > ? [ ] ^ _ { | } ~

some character sets don`t acutally have them. `Digraphs` and trigraphs
allow the use of the above required characters without actually using
them.

For example ISO/IEC646 (Information technology - ISO 7-bit coded
character set for information
interchange) which is quoted in 8988:1999 as a reference [1] doesn`t
actually have a # character

Of course, in general these days, the only use digraphs and trigraphs
have is in obfuscation - at least that`s the only use I`ve found for
them.


[1] <http://www.kostis.net/charsets/iso646.gb.htm>

--
PJH

Quantum materiae materietur marmota monax si marmota monax materiam
possit materiari?





Alderley plc, Arnolds Field Estate, The Downs, Wickwar, Gloucestershire, GL12
8JD, UK
Tel: +44(0)1454 294556 Fax: +44 (0)1454 299272

Website : www.alderley.com Sales : sales@... Service :
service@...

This email and its contents are confidential and are solely for the use of the
intended recipient. If you are not the original recipient you have received it
in error and any use, dissemination, forwarding, printing or copying of this
email is strictly prohibited. Should you receive this email in error please
immediately notify it@...

This email has been scanned for viruses, however you should always scan emails
with your own systems prior to opening.
Reply with quote
Send private message
View user's profile Post To page top
ashish_gupta... Posted: Mon Jan 24, 2005 4:12 pm


Joined: 24 Jan 2005

Posts: 2
Re: QUERRY about two-character punctuation tokens, called di
Thanks ,
your reply was very clear and it cleared my
doubt.

Regards
Ashish.

--- Paul Herring <pherring@...> wrote:

>
> From: Ashish Gupta
> [mailto:ashish_gupta_cal@...]
>
> >Hi,
> > C++ also recognizes two-character punctuation
> >tokens, called digraphs. The digraphs and their
> >equivalent tokens are:
> >
> > <: [
> > :> ]
> > <% {
> > %> }
> > %: #
> > %:%: ##
>
> These are actually called punctuators in ISO/IEC
> 9899:1999 (it uses the
> term digraph in "quotes" in a footnote).
>
> There also exist trigraphs:
>
> ??= #
> ??( [
> ??/
> ??) ]
> ??` ^
> ??< {
> ??! |
> ??> }
> ??- ~
>
>
> >The following program is valid in both C99 and C++:
>
> [snip]
>
> > My question is what is the need of such
> digraphs?
>
> Because while ISO/IEC 9899:1999 requires that (among
> others) the
> following characters `exist` in the "source
> character set" and
> "execution character set":
>
> ! " # % & ` ( ) * + , - . / :
>
> ; < = > ? [ ] ^ _ { | } ~
>
> some character sets don`t acutally have them.
> `Digraphs` and trigraphs
> allow the use of the above required characters
> without actually using
> them.
>
> For example ISO/IEC646 (Information technology - ISO
> 7-bit coded
> character set for information
> interchange) which is quoted in 8988:1999 as a
> reference [1] doesn`t
> actually have a # character
>
> Of course, in general these days, the only use
> digraphs and trigraphs
> have is in obfuscation - at least that`s the only
> use I`ve found for
> them.
>
>
> [1] <http://www.kostis.net/charsets/iso646.gb.htm>
>
> --
> PJH




__________________________________
Do you Yahoo!?
Yahoo! Mail - 250MB free storage. Do more. Manage less.
http://info.mail.yahoo.com/mail_250
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help