Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does ??(??) denote in C for iSeries

Tags:

c

I have been tasked with converting a C program from an iSeries/AS400 into .NET. It's been awhile since I've looked at C, and I've never used C on an iSeries before. I'm seeing items such as

main(int argc, char *argv ??(??))

I'm unsure what the ?? is for. Based upon the usage here, I would assume it is for arrays, but wanted to make sure before I go down the wrong path.

like image 908
Dave Simione Avatar asked Dec 26 '22 23:12

Dave Simione


2 Answers

??( is equivalent to [ and ??) is equivalent to ]. These are called trigraphs, and they're replaced by the preprocessor before anything else is done with the code. Here's a list of other trigraphs.

like image 74
StephenTG Avatar answered Jan 08 '23 11:01

StephenTG


It's called Trigraph:

C11(ISO/IEC 9899:201x) §5.2.1.1 Trigraph sequences

Before any other processing takes place, each occurrence of one of the following sequences of three characters (called trigraph sequences17)) is replaced with the corresponding single character.

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

So the code

main(int argc, char *argv ??(??))

turns to

main(int argc, char *argv [])
like image 39
Yu Hao Avatar answered Jan 08 '23 12:01

Yu Hao