What does ? in C mean?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







9















What does a question mark (?) in C mean?










share|improve this question


















  • 1





    Could you give us a contextual example of where you're seeing the '?'?

    – Rich Turner
    Feb 3 '11 at 10:45











  • @bitcrazed: Just curious: what other use than the ternary operator are you thinking of?

    – chris
    Feb 3 '11 at 10:48













  • @chris it's also (in seriously old code) part of a trigraph, as Benoit beat me to answering.

    – Rup
    Feb 3 '11 at 10:50











  • @bitcrazed: I read about those, never seen them in actual code though. Not even in really old code ;)

    – chris
    Feb 3 '11 at 10:58








  • 1





    @chris You're more likely to accidentally enter one and get compiler warnings about them rather than find real examples, yes.

    – Rup
    Feb 3 '11 at 10:59


















9















What does a question mark (?) in C mean?










share|improve this question


















  • 1





    Could you give us a contextual example of where you're seeing the '?'?

    – Rich Turner
    Feb 3 '11 at 10:45











  • @bitcrazed: Just curious: what other use than the ternary operator are you thinking of?

    – chris
    Feb 3 '11 at 10:48













  • @chris it's also (in seriously old code) part of a trigraph, as Benoit beat me to answering.

    – Rup
    Feb 3 '11 at 10:50











  • @bitcrazed: I read about those, never seen them in actual code though. Not even in really old code ;)

    – chris
    Feb 3 '11 at 10:58








  • 1





    @chris You're more likely to accidentally enter one and get compiler warnings about them rather than find real examples, yes.

    – Rup
    Feb 3 '11 at 10:59














9












9








9


4






What does a question mark (?) in C mean?










share|improve this question














What does a question mark (?) in C mean?







c






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 3 '11 at 10:43









Eric BrottoEric Brotto

36.4k27108168




36.4k27108168








  • 1





    Could you give us a contextual example of where you're seeing the '?'?

    – Rich Turner
    Feb 3 '11 at 10:45











  • @bitcrazed: Just curious: what other use than the ternary operator are you thinking of?

    – chris
    Feb 3 '11 at 10:48













  • @chris it's also (in seriously old code) part of a trigraph, as Benoit beat me to answering.

    – Rup
    Feb 3 '11 at 10:50











  • @bitcrazed: I read about those, never seen them in actual code though. Not even in really old code ;)

    – chris
    Feb 3 '11 at 10:58








  • 1





    @chris You're more likely to accidentally enter one and get compiler warnings about them rather than find real examples, yes.

    – Rup
    Feb 3 '11 at 10:59














  • 1





    Could you give us a contextual example of where you're seeing the '?'?

    – Rich Turner
    Feb 3 '11 at 10:45











  • @bitcrazed: Just curious: what other use than the ternary operator are you thinking of?

    – chris
    Feb 3 '11 at 10:48













  • @chris it's also (in seriously old code) part of a trigraph, as Benoit beat me to answering.

    – Rup
    Feb 3 '11 at 10:50











  • @bitcrazed: I read about those, never seen them in actual code though. Not even in really old code ;)

    – chris
    Feb 3 '11 at 10:58








  • 1





    @chris You're more likely to accidentally enter one and get compiler warnings about them rather than find real examples, yes.

    – Rup
    Feb 3 '11 at 10:59








1




1





Could you give us a contextual example of where you're seeing the '?'?

– Rich Turner
Feb 3 '11 at 10:45





Could you give us a contextual example of where you're seeing the '?'?

– Rich Turner
Feb 3 '11 at 10:45













@bitcrazed: Just curious: what other use than the ternary operator are you thinking of?

– chris
Feb 3 '11 at 10:48







@bitcrazed: Just curious: what other use than the ternary operator are you thinking of?

– chris
Feb 3 '11 at 10:48















@chris it's also (in seriously old code) part of a trigraph, as Benoit beat me to answering.

– Rup
Feb 3 '11 at 10:50





@chris it's also (in seriously old code) part of a trigraph, as Benoit beat me to answering.

– Rup
Feb 3 '11 at 10:50













@bitcrazed: I read about those, never seen them in actual code though. Not even in really old code ;)

– chris
Feb 3 '11 at 10:58







@bitcrazed: I read about those, never seen them in actual code though. Not even in really old code ;)

– chris
Feb 3 '11 at 10:58






1




1





@chris You're more likely to accidentally enter one and get compiler warnings about them rather than find real examples, yes.

– Rup
Feb 3 '11 at 10:59





@chris You're more likely to accidentally enter one and get compiler warnings about them rather than find real examples, yes.

– Rup
Feb 3 '11 at 10:59












8 Answers
8






active

oldest

votes


















20














? is the first symbol of the ?: ternary operator.



a = (b==0) ? 1 : 0;


a will have the value 1 if b is equal to 0, and 0 otherwise.






share|improve this answer































    12














    Additionally to other answers, ? can be part of a trigraph.






    share|improve this answer


























    • It can also be part of a string or character in general without being a trigraph: char c = '?'; char const * s = "?".

      – Thomas Eding
      Dec 8 '11 at 22:33



















    7














    This is a ternary Operator which is conditional operator uses like if-else



    example



    int i=1;
    int j=2;
    int k;
    k= i > j ? i : j;
    //which is same as
    if(i>j)
    k=i;
    else
    k=j;


    Usage:
    Syntax of ?: is



    assignment_Variable = Condition ? value_if_true : value_if_false;





    share|improve this answer

































      4














      That’s probably a part of the ternary operator:



      const int numApples = …;
      printf("I have %i apple%s.n", numApples == 1 ? "" : "s");





      share|improve this answer
























      • Just to save future generations on any confusion here. It is the "conditional operator". It just happens to be a ternary operator, of which there is only one in C and C++. There are lots of unary (~, !, -) and binary (+, -, <<) operators in C/C++ as well. Neato!

        – Thomas Eding
        Dec 8 '11 at 22:17



















      4














      This is a so called conditional operator. You can shorten your if else statement with this operator.



      The following link should explain everything



      http://www.crasseux.com/books/ctutorial/The-question-mark-operator.html






      share|improve this answer































        3














        It is a conditional operator. For example refer the below link
        http://en.wikipedia.org/wiki/Conditional_operator






        share|improve this answer































          2














          Its the ternary operator, see http://en.wikipedia.org/wiki/Ternary_operation#C.2C_C.2B.2B.2C_C.23.2C_Objective-C.2C_Java.2C_JavaScript.2C_ActionScript






          share|improve this answer































            1














            Most likely the '?' is the ternary operator. Its grammar is:



            RESULT = (COND) ? (STATEMEN IF TRUE) : (STATEMENT IF FALSE)


            It is a nice shorthand for the typical if-else statement:



            if (COND) {
            RESULT = (STATEMENT IF TRUE);
            } else {
            RESULT = (STATEMENT IF FALSE);


            as it can usually fit on one line and can improve readability.



            Some answers here refer to a trigraph, which is relevant to the C preprocessor. Take a look at this really dumb program, trigraphs.c:



            # /* preprocessor will remove single hash symbols and this comment */
            int main()
            {
            char *t = "??=";
            char *p = "??/"";
            char *s = "??'";
            ??(, ??), ??! ??<, ??>, ??-
            return 0;
            }


            invoking only the c preprocessor by running gcc -E -trigraphs trigraph.c the output is



            int main()
            {
            char *t = "#"
            char *p = """;
            char *s = "^";
            [, ], | {, }, ~
            return 0;
            }


            Hopefully that clarifies a little bit what a trigraphs are, and what a '?' "means" in C.






            share|improve this answer
























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4885143%2fwhat-does-in-c-mean%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              8 Answers
              8






              active

              oldest

              votes








              8 Answers
              8






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              20














              ? is the first symbol of the ?: ternary operator.



              a = (b==0) ? 1 : 0;


              a will have the value 1 if b is equal to 0, and 0 otherwise.






              share|improve this answer




























                20














                ? is the first symbol of the ?: ternary operator.



                a = (b==0) ? 1 : 0;


                a will have the value 1 if b is equal to 0, and 0 otherwise.






                share|improve this answer


























                  20












                  20








                  20







                  ? is the first symbol of the ?: ternary operator.



                  a = (b==0) ? 1 : 0;


                  a will have the value 1 if b is equal to 0, and 0 otherwise.






                  share|improve this answer













                  ? is the first symbol of the ?: ternary operator.



                  a = (b==0) ? 1 : 0;


                  a will have the value 1 if b is equal to 0, and 0 otherwise.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 3 '11 at 10:45









                  Didier TrossetDidier Trosset

                  27.6k1364102




                  27.6k1364102

























                      12














                      Additionally to other answers, ? can be part of a trigraph.






                      share|improve this answer


























                      • It can also be part of a string or character in general without being a trigraph: char c = '?'; char const * s = "?".

                        – Thomas Eding
                        Dec 8 '11 at 22:33
















                      12














                      Additionally to other answers, ? can be part of a trigraph.






                      share|improve this answer


























                      • It can also be part of a string or character in general without being a trigraph: char c = '?'; char const * s = "?".

                        – Thomas Eding
                        Dec 8 '11 at 22:33














                      12












                      12








                      12







                      Additionally to other answers, ? can be part of a trigraph.






                      share|improve this answer















                      Additionally to other answers, ? can be part of a trigraph.







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Mar 24 '16 at 14:55









                      tripleee

                      96.6k14135191




                      96.6k14135191










                      answered Feb 3 '11 at 10:47









                      BenoitBenoit

                      60.1k15170213




                      60.1k15170213













                      • It can also be part of a string or character in general without being a trigraph: char c = '?'; char const * s = "?".

                        – Thomas Eding
                        Dec 8 '11 at 22:33



















                      • It can also be part of a string or character in general without being a trigraph: char c = '?'; char const * s = "?".

                        – Thomas Eding
                        Dec 8 '11 at 22:33

















                      It can also be part of a string or character in general without being a trigraph: char c = '?'; char const * s = "?".

                      – Thomas Eding
                      Dec 8 '11 at 22:33





                      It can also be part of a string or character in general without being a trigraph: char c = '?'; char const * s = "?".

                      – Thomas Eding
                      Dec 8 '11 at 22:33











                      7














                      This is a ternary Operator which is conditional operator uses like if-else



                      example



                      int i=1;
                      int j=2;
                      int k;
                      k= i > j ? i : j;
                      //which is same as
                      if(i>j)
                      k=i;
                      else
                      k=j;


                      Usage:
                      Syntax of ?: is



                      assignment_Variable = Condition ? value_if_true : value_if_false;





                      share|improve this answer






























                        7














                        This is a ternary Operator which is conditional operator uses like if-else



                        example



                        int i=1;
                        int j=2;
                        int k;
                        k= i > j ? i : j;
                        //which is same as
                        if(i>j)
                        k=i;
                        else
                        k=j;


                        Usage:
                        Syntax of ?: is



                        assignment_Variable = Condition ? value_if_true : value_if_false;





                        share|improve this answer




























                          7












                          7








                          7







                          This is a ternary Operator which is conditional operator uses like if-else



                          example



                          int i=1;
                          int j=2;
                          int k;
                          k= i > j ? i : j;
                          //which is same as
                          if(i>j)
                          k=i;
                          else
                          k=j;


                          Usage:
                          Syntax of ?: is



                          assignment_Variable = Condition ? value_if_true : value_if_false;





                          share|improve this answer















                          This is a ternary Operator which is conditional operator uses like if-else



                          example



                          int i=1;
                          int j=2;
                          int k;
                          k= i > j ? i : j;
                          //which is same as
                          if(i>j)
                          k=i;
                          else
                          k=j;


                          Usage:
                          Syntax of ?: is



                          assignment_Variable = Condition ? value_if_true : value_if_false;






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Feb 3 '11 at 10:54

























                          answered Feb 3 '11 at 10:48









                          Javed AkramJaved Akram

                          9,7372270109




                          9,7372270109























                              4














                              That’s probably a part of the ternary operator:



                              const int numApples = …;
                              printf("I have %i apple%s.n", numApples == 1 ? "" : "s");





                              share|improve this answer
























                              • Just to save future generations on any confusion here. It is the "conditional operator". It just happens to be a ternary operator, of which there is only one in C and C++. There are lots of unary (~, !, -) and binary (+, -, <<) operators in C/C++ as well. Neato!

                                – Thomas Eding
                                Dec 8 '11 at 22:17
















                              4














                              That’s probably a part of the ternary operator:



                              const int numApples = …;
                              printf("I have %i apple%s.n", numApples == 1 ? "" : "s");





                              share|improve this answer
























                              • Just to save future generations on any confusion here. It is the "conditional operator". It just happens to be a ternary operator, of which there is only one in C and C++. There are lots of unary (~, !, -) and binary (+, -, <<) operators in C/C++ as well. Neato!

                                – Thomas Eding
                                Dec 8 '11 at 22:17














                              4












                              4








                              4







                              That’s probably a part of the ternary operator:



                              const int numApples = …;
                              printf("I have %i apple%s.n", numApples == 1 ? "" : "s");





                              share|improve this answer













                              That’s probably a part of the ternary operator:



                              const int numApples = …;
                              printf("I have %i apple%s.n", numApples == 1 ? "" : "s");






                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Feb 3 '11 at 10:45









                              zoulzoul

                              79.4k37224324




                              79.4k37224324













                              • Just to save future generations on any confusion here. It is the "conditional operator". It just happens to be a ternary operator, of which there is only one in C and C++. There are lots of unary (~, !, -) and binary (+, -, <<) operators in C/C++ as well. Neato!

                                – Thomas Eding
                                Dec 8 '11 at 22:17



















                              • Just to save future generations on any confusion here. It is the "conditional operator". It just happens to be a ternary operator, of which there is only one in C and C++. There are lots of unary (~, !, -) and binary (+, -, <<) operators in C/C++ as well. Neato!

                                – Thomas Eding
                                Dec 8 '11 at 22:17

















                              Just to save future generations on any confusion here. It is the "conditional operator". It just happens to be a ternary operator, of which there is only one in C and C++. There are lots of unary (~, !, -) and binary (+, -, <<) operators in C/C++ as well. Neato!

                              – Thomas Eding
                              Dec 8 '11 at 22:17





                              Just to save future generations on any confusion here. It is the "conditional operator". It just happens to be a ternary operator, of which there is only one in C and C++. There are lots of unary (~, !, -) and binary (+, -, <<) operators in C/C++ as well. Neato!

                              – Thomas Eding
                              Dec 8 '11 at 22:17











                              4














                              This is a so called conditional operator. You can shorten your if else statement with this operator.



                              The following link should explain everything



                              http://www.crasseux.com/books/ctutorial/The-question-mark-operator.html






                              share|improve this answer




























                                4














                                This is a so called conditional operator. You can shorten your if else statement with this operator.



                                The following link should explain everything



                                http://www.crasseux.com/books/ctutorial/The-question-mark-operator.html






                                share|improve this answer


























                                  4












                                  4








                                  4







                                  This is a so called conditional operator. You can shorten your if else statement with this operator.



                                  The following link should explain everything



                                  http://www.crasseux.com/books/ctutorial/The-question-mark-operator.html






                                  share|improve this answer













                                  This is a so called conditional operator. You can shorten your if else statement with this operator.



                                  The following link should explain everything



                                  http://www.crasseux.com/books/ctutorial/The-question-mark-operator.html







                                  share|improve this answer












                                  share|improve this answer



                                  share|improve this answer










                                  answered Feb 3 '11 at 10:46









                                  Stefan PappStefan Papp

                                  1,38111335




                                  1,38111335























                                      3














                                      It is a conditional operator. For example refer the below link
                                      http://en.wikipedia.org/wiki/Conditional_operator






                                      share|improve this answer




























                                        3














                                        It is a conditional operator. For example refer the below link
                                        http://en.wikipedia.org/wiki/Conditional_operator






                                        share|improve this answer


























                                          3












                                          3








                                          3







                                          It is a conditional operator. For example refer the below link
                                          http://en.wikipedia.org/wiki/Conditional_operator






                                          share|improve this answer













                                          It is a conditional operator. For example refer the below link
                                          http://en.wikipedia.org/wiki/Conditional_operator







                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Feb 3 '11 at 10:45









                                          ckvckv

                                          5,1781568126




                                          5,1781568126























                                              2














                                              Its the ternary operator, see http://en.wikipedia.org/wiki/Ternary_operation#C.2C_C.2B.2B.2C_C.23.2C_Objective-C.2C_Java.2C_JavaScript.2C_ActionScript






                                              share|improve this answer




























                                                2














                                                Its the ternary operator, see http://en.wikipedia.org/wiki/Ternary_operation#C.2C_C.2B.2B.2C_C.23.2C_Objective-C.2C_Java.2C_JavaScript.2C_ActionScript






                                                share|improve this answer


























                                                  2












                                                  2








                                                  2







                                                  Its the ternary operator, see http://en.wikipedia.org/wiki/Ternary_operation#C.2C_C.2B.2B.2C_C.23.2C_Objective-C.2C_Java.2C_JavaScript.2C_ActionScript






                                                  share|improve this answer













                                                  Its the ternary operator, see http://en.wikipedia.org/wiki/Ternary_operation#C.2C_C.2B.2B.2C_C.23.2C_Objective-C.2C_Java.2C_JavaScript.2C_ActionScript







                                                  share|improve this answer












                                                  share|improve this answer



                                                  share|improve this answer










                                                  answered Feb 3 '11 at 10:45









                                                  ismailismail

                                                  34.9k87186




                                                  34.9k87186























                                                      1














                                                      Most likely the '?' is the ternary operator. Its grammar is:



                                                      RESULT = (COND) ? (STATEMEN IF TRUE) : (STATEMENT IF FALSE)


                                                      It is a nice shorthand for the typical if-else statement:



                                                      if (COND) {
                                                      RESULT = (STATEMENT IF TRUE);
                                                      } else {
                                                      RESULT = (STATEMENT IF FALSE);


                                                      as it can usually fit on one line and can improve readability.



                                                      Some answers here refer to a trigraph, which is relevant to the C preprocessor. Take a look at this really dumb program, trigraphs.c:



                                                      # /* preprocessor will remove single hash symbols and this comment */
                                                      int main()
                                                      {
                                                      char *t = "??=";
                                                      char *p = "??/"";
                                                      char *s = "??'";
                                                      ??(, ??), ??! ??<, ??>, ??-
                                                      return 0;
                                                      }


                                                      invoking only the c preprocessor by running gcc -E -trigraphs trigraph.c the output is



                                                      int main()
                                                      {
                                                      char *t = "#"
                                                      char *p = """;
                                                      char *s = "^";
                                                      [, ], | {, }, ~
                                                      return 0;
                                                      }


                                                      Hopefully that clarifies a little bit what a trigraphs are, and what a '?' "means" in C.






                                                      share|improve this answer




























                                                        1














                                                        Most likely the '?' is the ternary operator. Its grammar is:



                                                        RESULT = (COND) ? (STATEMEN IF TRUE) : (STATEMENT IF FALSE)


                                                        It is a nice shorthand for the typical if-else statement:



                                                        if (COND) {
                                                        RESULT = (STATEMENT IF TRUE);
                                                        } else {
                                                        RESULT = (STATEMENT IF FALSE);


                                                        as it can usually fit on one line and can improve readability.



                                                        Some answers here refer to a trigraph, which is relevant to the C preprocessor. Take a look at this really dumb program, trigraphs.c:



                                                        # /* preprocessor will remove single hash symbols and this comment */
                                                        int main()
                                                        {
                                                        char *t = "??=";
                                                        char *p = "??/"";
                                                        char *s = "??'";
                                                        ??(, ??), ??! ??<, ??>, ??-
                                                        return 0;
                                                        }


                                                        invoking only the c preprocessor by running gcc -E -trigraphs trigraph.c the output is



                                                        int main()
                                                        {
                                                        char *t = "#"
                                                        char *p = """;
                                                        char *s = "^";
                                                        [, ], | {, }, ~
                                                        return 0;
                                                        }


                                                        Hopefully that clarifies a little bit what a trigraphs are, and what a '?' "means" in C.






                                                        share|improve this answer


























                                                          1












                                                          1








                                                          1







                                                          Most likely the '?' is the ternary operator. Its grammar is:



                                                          RESULT = (COND) ? (STATEMEN IF TRUE) : (STATEMENT IF FALSE)


                                                          It is a nice shorthand for the typical if-else statement:



                                                          if (COND) {
                                                          RESULT = (STATEMENT IF TRUE);
                                                          } else {
                                                          RESULT = (STATEMENT IF FALSE);


                                                          as it can usually fit on one line and can improve readability.



                                                          Some answers here refer to a trigraph, which is relevant to the C preprocessor. Take a look at this really dumb program, trigraphs.c:



                                                          # /* preprocessor will remove single hash symbols and this comment */
                                                          int main()
                                                          {
                                                          char *t = "??=";
                                                          char *p = "??/"";
                                                          char *s = "??'";
                                                          ??(, ??), ??! ??<, ??>, ??-
                                                          return 0;
                                                          }


                                                          invoking only the c preprocessor by running gcc -E -trigraphs trigraph.c the output is



                                                          int main()
                                                          {
                                                          char *t = "#"
                                                          char *p = """;
                                                          char *s = "^";
                                                          [, ], | {, }, ~
                                                          return 0;
                                                          }


                                                          Hopefully that clarifies a little bit what a trigraphs are, and what a '?' "means" in C.






                                                          share|improve this answer













                                                          Most likely the '?' is the ternary operator. Its grammar is:



                                                          RESULT = (COND) ? (STATEMEN IF TRUE) : (STATEMENT IF FALSE)


                                                          It is a nice shorthand for the typical if-else statement:



                                                          if (COND) {
                                                          RESULT = (STATEMENT IF TRUE);
                                                          } else {
                                                          RESULT = (STATEMENT IF FALSE);


                                                          as it can usually fit on one line and can improve readability.



                                                          Some answers here refer to a trigraph, which is relevant to the C preprocessor. Take a look at this really dumb program, trigraphs.c:



                                                          # /* preprocessor will remove single hash symbols and this comment */
                                                          int main()
                                                          {
                                                          char *t = "??=";
                                                          char *p = "??/"";
                                                          char *s = "??'";
                                                          ??(, ??), ??! ??<, ??>, ??-
                                                          return 0;
                                                          }


                                                          invoking only the c preprocessor by running gcc -E -trigraphs trigraph.c the output is



                                                          int main()
                                                          {
                                                          char *t = "#"
                                                          char *p = """;
                                                          char *s = "^";
                                                          [, ], | {, }, ~
                                                          return 0;
                                                          }


                                                          Hopefully that clarifies a little bit what a trigraphs are, and what a '?' "means" in C.







                                                          share|improve this answer












                                                          share|improve this answer



                                                          share|improve this answer










                                                          answered Jan 23 '16 at 19:41









                                                          bpmbpm

                                                          874




                                                          874






























                                                              draft saved

                                                              draft discarded




















































                                                              Thanks for contributing an answer to Stack Overflow!


                                                              • Please be sure to answer the question. Provide details and share your research!

                                                              But avoid



                                                              • Asking for help, clarification, or responding to other answers.

                                                              • Making statements based on opinion; back them up with references or personal experience.


                                                              To learn more, see our tips on writing great answers.




                                                              draft saved


                                                              draft discarded














                                                              StackExchange.ready(
                                                              function () {
                                                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4885143%2fwhat-does-in-c-mean%23new-answer', 'question_page');
                                                              }
                                                              );

                                                              Post as a guest















                                                              Required, but never shown





















































                                                              Required, but never shown














                                                              Required, but never shown












                                                              Required, but never shown







                                                              Required, but never shown

































                                                              Required, but never shown














                                                              Required, but never shown












                                                              Required, but never shown







                                                              Required, but never shown







                                                              Popular posts from this blog

                                                              Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                                                              ComboBox Display Member on multiple fields

                                                              Is it possible to collect Nectar points via Trainline?