The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



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

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 01:31 PM
copying image sequences jonson Shell Programming and Scripting 1 11-15-2006 06:16 AM
Available escape sequences Love SUN Solaris 6 06-20-2006 07:31 AM
AWK and hex sequences JoeTheGuy Shell Programming and Scripting 5 10-17-2002 08:17 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 3 Weeks Ago
MrUser's Avatar
MrUser MrUser is offline
Registered User
  
 

Join Date: Oct 2009
Location: Earth
Posts: 23
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.
  #2 (permalink)  
Old 3 Weeks Ago
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,921
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?
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 On




All times are GMT -4. The time now is 04:03 PM.


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-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0