Thread: What the heck is ??(??)

  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    2

    Question What the heck is ??(??)

    I'm have coded in c for a while but I've come across some source code that contains something I've never seen:

    char in_proc ??(??) = "INITIAL PROCEDURE";

    I have no idea what ??(??) does in this case. Does this make me a terrible c programmer? Could someone explain what it does?

    Best regards,

    Rembi

  2. #2
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,834
    Must be in a commented section. It's illegal.

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    11
    It's not illegal at all. Look up "Digraphs and trigraphs" on Wikipedia.

  4. #4
    The larch
    Join Date
    May 2006
    Posts
    3,573
    Actually it is legal. See trigraphs in C.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  5. #5
    Registered User
    Join Date
    Jan 2008
    Posts
    28
    so according to the wiki ??(??) = []

  6. #6
    Registered User
    Join Date
    Jan 2010
    Location
    Ca, US
    Posts
    29

    Thumbs up

    Good to know, now I can buy those cheep keyboards missing some keys..

    I have never run into any code with them, but don't see too much C code these days at work

    Dylan

  7. #7
    The larch
    Join Date
    May 2006
    Posts
    3,573
    I think they only have a place in code obfuscation contests.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  8. #8
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    That is quite zany. Can hardly wait to make use of this feature.

    Quote Originally Posted by dylan View Post
    don't see too much C code these days at work
    It's an "MS+web-dev" world I guess.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  9. #9
    Registered User
    Join Date
    Mar 2010
    Posts
    2
    Thanks for the reply guys, much appreciated

    Rembi

  10. #10
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,834
    Thanks, rabidbadger and anon. I learned something. Bizarre. I've never seen a shortage of "[", "]", etc. in a character set that was limited to 7 bits. ASCII was perfectly adequate for the job and did not require digraphs. And I come from using paper tape on a teletype.

    So as I understand it, the C committee in 1994 decided to make C compatible with character encoding that is already over 20 years old and long obsolete. Way to go!

  11. #11
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by nonoob View Post
    Thanks, rabidbadger and anon. I learned something. Bizarre. I've never seen a shortage of "[", "]", etc. in a character set that was limited to 7 bits. ASCII was perfectly adequate for the job and did not require digraphs. And I come from using paper tape on a teletype.

    So as I understand it, the C committee in 1994 decided to make C compatible with character encoding that is already over 20 years old and long obsolete. Way to go!
    I suspect it was less EBCDIC and more non-English types where punctuation can be surprisingly absent.

  12. #12
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    Quote Originally Posted by anon View Post
    I think they only have a place in code obfuscation contests.
    Apparently IBM uses trigraphs for compiling in EBCDIC. It's the reason trigraphs are still in C++0x.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how the heck do i ftp?
    By Waldo2k2 in forum Tech Board
    Replies: 9
    Last Post: 03-03-2003, 06:51 AM
  2. Thunderbird, Thoroughbred, Palomino, Morgan - What the heck ?
    By Zeeshan in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 07-09-2002, 04:34 AM
  3. Where the heck is sleep()?
    By Credo in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 02-15-2002, 04:20 PM
  4. Replies: 2
    Last Post: 11-29-2001, 06:13 PM
  5. what the HECK?!?!?!?
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-26-2001, 08:12 PM