Go Back   The UNIX and Linux Forums > Top Forums > Programming
.
google site



Programming Post questions about C, C++, Java, SQL, and other programming languages here.

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-03-2009
MrUser's Avatar
Registered User
 

Join Date: Oct 2009
Location: Earth
Posts: 27
Trigraph sequences

Hi,

i have read trigraph sequence in
The C99 Draft (N869, 18 January, 1999)

printf("Eh???/n");
will produce
printf("Eh?\n");

what does that mean?
i tried that but i am getting the same output i.e
Eh???/n.

what actually these tri graph characters are?
any idea why ,when and where these are used?

Thanks for your valuable answers.
Sponsored Links
  #2 (permalink)  
Old 11-03-2009
fpmurphy's Avatar
Moderator
 

Join Date: Dec 2003
Location: Florida
Posts: 2,101
Some characters in the C/C++ basic character set are not available on all keyboards. Trigraphs were "invented" to enable these characters to be entered into C/ C++ source code using a sequence of three ISO 646 characters. More information is available in this Wikipedia: Digraphs and trigraphs article.

With gcc you have to use the --trigraph option to enable trigraph functionality.

Code:
$ cat t.c
#include <stdio.h>

main()
{
    printf("Eh???/n");
}

$ gcc -o t t.c
$ ./t
Eh???/n$

$ gcc --trigraphs -o t t.c
$ ./t
Eh?

Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Deal with binary sequences Indalecio UNIX for Advanced & Expert Users 2 02-09-2009 04:25 PM
Escape Sequences appearing in scripts jwm-wm UNIX for Dummies Questions & Answers 1 05-08-2008 02:31 PM
copying image sequences jonson Shell Programming and Scripting 1 11-15-2006 06:16 AM
Available escape sequences Love Solaris 6 06-20-2006 08:31 AM
AWK and hex sequences JoeTheGuy Shell Programming and Scripting 5 10-17-2002 09:17 AM



All times are GMT -4. The time now is 09:46 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0