Why would `(int)` precede an assignment in C++?












-1















Here is a MWE of something I came across in some C++ code.



int a = (int)(b/c);


Why is (int) after the assignment operator?



Is it not recommended to use it like this?










share|improve this question




















  • 1





    Depends on specific language (so, update the question with appropriate/relevant tags): presumably the result of b/c is a "float" and needs an explicit cast to an "int" before assignment. Not quite sure why "int" is considered a class either..

    – user2864740
    Nov 23 '18 at 0:35













  • There's no assignment operator in this code. In a definition the = symbol is not an operator; it's syntax which indicates that an initializer for the variable being defined follows.

    – M.M
    Nov 23 '18 at 4:05
















-1















Here is a MWE of something I came across in some C++ code.



int a = (int)(b/c);


Why is (int) after the assignment operator?



Is it not recommended to use it like this?










share|improve this question




















  • 1





    Depends on specific language (so, update the question with appropriate/relevant tags): presumably the result of b/c is a "float" and needs an explicit cast to an "int" before assignment. Not quite sure why "int" is considered a class either..

    – user2864740
    Nov 23 '18 at 0:35













  • There's no assignment operator in this code. In a definition the = symbol is not an operator; it's syntax which indicates that an initializer for the variable being defined follows.

    – M.M
    Nov 23 '18 at 4:05














-1












-1








-1








Here is a MWE of something I came across in some C++ code.



int a = (int)(b/c);


Why is (int) after the assignment operator?



Is it not recommended to use it like this?










share|improve this question
















Here is a MWE of something I came across in some C++ code.



int a = (int)(b/c);


Why is (int) after the assignment operator?



Is it not recommended to use it like this?







c++ syntax variable-assignment






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 2:54









John3136

24.3k33361




24.3k33361










asked Nov 23 '18 at 0:34









kapplekapple

12




12








  • 1





    Depends on specific language (so, update the question with appropriate/relevant tags): presumably the result of b/c is a "float" and needs an explicit cast to an "int" before assignment. Not quite sure why "int" is considered a class either..

    – user2864740
    Nov 23 '18 at 0:35













  • There's no assignment operator in this code. In a definition the = symbol is not an operator; it's syntax which indicates that an initializer for the variable being defined follows.

    – M.M
    Nov 23 '18 at 4:05














  • 1





    Depends on specific language (so, update the question with appropriate/relevant tags): presumably the result of b/c is a "float" and needs an explicit cast to an "int" before assignment. Not quite sure why "int" is considered a class either..

    – user2864740
    Nov 23 '18 at 0:35













  • There's no assignment operator in this code. In a definition the = symbol is not an operator; it's syntax which indicates that an initializer for the variable being defined follows.

    – M.M
    Nov 23 '18 at 4:05








1




1





Depends on specific language (so, update the question with appropriate/relevant tags): presumably the result of b/c is a "float" and needs an explicit cast to an "int" before assignment. Not quite sure why "int" is considered a class either..

– user2864740
Nov 23 '18 at 0:35







Depends on specific language (so, update the question with appropriate/relevant tags): presumably the result of b/c is a "float" and needs an explicit cast to an "int" before assignment. Not quite sure why "int" is considered a class either..

– user2864740
Nov 23 '18 at 0:35















There's no assignment operator in this code. In a definition the = symbol is not an operator; it's syntax which indicates that an initializer for the variable being defined follows.

– M.M
Nov 23 '18 at 4:05





There's no assignment operator in this code. In a definition the = symbol is not an operator; it's syntax which indicates that an initializer for the variable being defined follows.

– M.M
Nov 23 '18 at 4:05












4 Answers
4






active

oldest

votes


















3














This is simply a C-style typecast. It is used to make the author's intentions explicit, especially when the result of b/c is of another type (such as unsigned or float).



Without the cast, you will often get a compiler warning about an implicit conversion which can sometimes have consequences. By using the explicit cast, you are stating that you accept this conversion is fine within whatever other limits your program enforces, and the compiler will perform the conversion without emitting a warning.



In C++, we use static_cast<int>(b/c) to make the cast even more explicit and intentional.






share|improve this answer































    1














    It is not "(int) after the assignment operator".



    It is "(int) before a float - the result of b/c".



    It casts the float to an int.






    share|improve this answer































      0














      This is a cast used to convert a variable or expression to a given type. In this case if b and c were floating point numbers, adding the cast (int) forces the result to an integer.



      Specifically this is a "C style cast", modern C++ has some additional casts to given even more control (static_cast, dynamic_cast, const_cast etc)






      share|improve this answer
























      • Does it return the integer part, round down, or round up? Also, thanks for responding, to all that identified this as a style cast.

        – kapple
        Nov 27 '18 at 0:21













      • Search is your friend: "does C cast round" will lead you here: stackoverflow.com/a/11128755/857132

        – John3136
        Nov 27 '18 at 0:25



















      0














      This is a mistake. In the code:



      int a = b/c;


      then it may cause undefined behaviour if the result of the division is a floating point value that is out of range of int (e.g. it exceeds INT_MAX after truncation). Compilers may warn about this if you use warning flags.





      Changing the code to int a = (int)(b/c); has no effect on the behaviour of the code, but it may cause the compiler to suppress the warning (compilers sometimes treat a cast as the programmer expressing the intent that they do not want to see the warning).



      So now you just have silent undefined behaviour, unless the previous code is designed in such a way that the division result can never be out of range.



      A better solution to the problem would be:



      long a = std::lrint(b/c);


      If the quotient is out of range then this will store an unspecified value in a and you can detect the error using floating point error handling. Reference for std::lrint






      share|improve this answer



















      • 1





        I understand what you're getting at, but I don't think starting your message with a "This is a mistake" is a good idea. It gets people's attention but both the OP's line and the line that you gave does compile. It also might be fine for someone in their first hour or two of C (and then the lecturer/teacher might show why it's wrong in the third hour and use it to explain casting).

        – Ray
        Nov 23 '18 at 4:25






      • 1





        Anyway, to the OP, I think you should take such advice carefully. If you are taking a class and start using std::lrint, your teacher might wonder who else are you asking for help. It's ok to be a "little" wrong when you're starting out; learning is a step-by-step process. But yes, if you want to hear the ending to the story, that's ok too!

        – Ray
        Nov 23 '18 at 4:27











      • @Ray the Q/A on this site are for anyone to read, not just OP

        – M.M
        Nov 23 '18 at 6:14






      • 1





        I know. But your answer is given within the context of the OP's original question. Surely there's some compromise between providing information for anyone to read and sticking to the original OP's question.

        – Ray
        Nov 23 '18 at 15:14











      • @Ray that's why multiple answers are allowed ...

        – M.M
        Nov 24 '18 at 1:19











      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%2f53439424%2fwhy-would-int-precede-an-assignment-in-c%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3














      This is simply a C-style typecast. It is used to make the author's intentions explicit, especially when the result of b/c is of another type (such as unsigned or float).



      Without the cast, you will often get a compiler warning about an implicit conversion which can sometimes have consequences. By using the explicit cast, you are stating that you accept this conversion is fine within whatever other limits your program enforces, and the compiler will perform the conversion without emitting a warning.



      In C++, we use static_cast<int>(b/c) to make the cast even more explicit and intentional.






      share|improve this answer




























        3














        This is simply a C-style typecast. It is used to make the author's intentions explicit, especially when the result of b/c is of another type (such as unsigned or float).



        Without the cast, you will often get a compiler warning about an implicit conversion which can sometimes have consequences. By using the explicit cast, you are stating that you accept this conversion is fine within whatever other limits your program enforces, and the compiler will perform the conversion without emitting a warning.



        In C++, we use static_cast<int>(b/c) to make the cast even more explicit and intentional.






        share|improve this answer


























          3












          3








          3







          This is simply a C-style typecast. It is used to make the author's intentions explicit, especially when the result of b/c is of another type (such as unsigned or float).



          Without the cast, you will often get a compiler warning about an implicit conversion which can sometimes have consequences. By using the explicit cast, you are stating that you accept this conversion is fine within whatever other limits your program enforces, and the compiler will perform the conversion without emitting a warning.



          In C++, we use static_cast<int>(b/c) to make the cast even more explicit and intentional.






          share|improve this answer













          This is simply a C-style typecast. It is used to make the author's intentions explicit, especially when the result of b/c is of another type (such as unsigned or float).



          Without the cast, you will often get a compiler warning about an implicit conversion which can sometimes have consequences. By using the explicit cast, you are stating that you accept this conversion is fine within whatever other limits your program enforces, and the compiler will perform the conversion without emitting a warning.



          In C++, we use static_cast<int>(b/c) to make the cast even more explicit and intentional.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 23 '18 at 2:58









          paddypaddy

          43.5k53277




          43.5k53277

























              1














              It is not "(int) after the assignment operator".



              It is "(int) before a float - the result of b/c".



              It casts the float to an int.






              share|improve this answer




























                1














                It is not "(int) after the assignment operator".



                It is "(int) before a float - the result of b/c".



                It casts the float to an int.






                share|improve this answer


























                  1












                  1








                  1







                  It is not "(int) after the assignment operator".



                  It is "(int) before a float - the result of b/c".



                  It casts the float to an int.






                  share|improve this answer













                  It is not "(int) after the assignment operator".



                  It is "(int) before a float - the result of b/c".



                  It casts the float to an int.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 23 '18 at 3:05









                  ZhangZhang

                  8911413




                  8911413























                      0














                      This is a cast used to convert a variable or expression to a given type. In this case if b and c were floating point numbers, adding the cast (int) forces the result to an integer.



                      Specifically this is a "C style cast", modern C++ has some additional casts to given even more control (static_cast, dynamic_cast, const_cast etc)






                      share|improve this answer
























                      • Does it return the integer part, round down, or round up? Also, thanks for responding, to all that identified this as a style cast.

                        – kapple
                        Nov 27 '18 at 0:21













                      • Search is your friend: "does C cast round" will lead you here: stackoverflow.com/a/11128755/857132

                        – John3136
                        Nov 27 '18 at 0:25
















                      0














                      This is a cast used to convert a variable or expression to a given type. In this case if b and c were floating point numbers, adding the cast (int) forces the result to an integer.



                      Specifically this is a "C style cast", modern C++ has some additional casts to given even more control (static_cast, dynamic_cast, const_cast etc)






                      share|improve this answer
























                      • Does it return the integer part, round down, or round up? Also, thanks for responding, to all that identified this as a style cast.

                        – kapple
                        Nov 27 '18 at 0:21













                      • Search is your friend: "does C cast round" will lead you here: stackoverflow.com/a/11128755/857132

                        – John3136
                        Nov 27 '18 at 0:25














                      0












                      0








                      0







                      This is a cast used to convert a variable or expression to a given type. In this case if b and c were floating point numbers, adding the cast (int) forces the result to an integer.



                      Specifically this is a "C style cast", modern C++ has some additional casts to given even more control (static_cast, dynamic_cast, const_cast etc)






                      share|improve this answer













                      This is a cast used to convert a variable or expression to a given type. In this case if b and c were floating point numbers, adding the cast (int) forces the result to an integer.



                      Specifically this is a "C style cast", modern C++ has some additional casts to given even more control (static_cast, dynamic_cast, const_cast etc)







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Nov 23 '18 at 2:56









                      John3136John3136

                      24.3k33361




                      24.3k33361













                      • Does it return the integer part, round down, or round up? Also, thanks for responding, to all that identified this as a style cast.

                        – kapple
                        Nov 27 '18 at 0:21













                      • Search is your friend: "does C cast round" will lead you here: stackoverflow.com/a/11128755/857132

                        – John3136
                        Nov 27 '18 at 0:25



















                      • Does it return the integer part, round down, or round up? Also, thanks for responding, to all that identified this as a style cast.

                        – kapple
                        Nov 27 '18 at 0:21













                      • Search is your friend: "does C cast round" will lead you here: stackoverflow.com/a/11128755/857132

                        – John3136
                        Nov 27 '18 at 0:25

















                      Does it return the integer part, round down, or round up? Also, thanks for responding, to all that identified this as a style cast.

                      – kapple
                      Nov 27 '18 at 0:21







                      Does it return the integer part, round down, or round up? Also, thanks for responding, to all that identified this as a style cast.

                      – kapple
                      Nov 27 '18 at 0:21















                      Search is your friend: "does C cast round" will lead you here: stackoverflow.com/a/11128755/857132

                      – John3136
                      Nov 27 '18 at 0:25





                      Search is your friend: "does C cast round" will lead you here: stackoverflow.com/a/11128755/857132

                      – John3136
                      Nov 27 '18 at 0:25











                      0














                      This is a mistake. In the code:



                      int a = b/c;


                      then it may cause undefined behaviour if the result of the division is a floating point value that is out of range of int (e.g. it exceeds INT_MAX after truncation). Compilers may warn about this if you use warning flags.





                      Changing the code to int a = (int)(b/c); has no effect on the behaviour of the code, but it may cause the compiler to suppress the warning (compilers sometimes treat a cast as the programmer expressing the intent that they do not want to see the warning).



                      So now you just have silent undefined behaviour, unless the previous code is designed in such a way that the division result can never be out of range.



                      A better solution to the problem would be:



                      long a = std::lrint(b/c);


                      If the quotient is out of range then this will store an unspecified value in a and you can detect the error using floating point error handling. Reference for std::lrint






                      share|improve this answer



















                      • 1





                        I understand what you're getting at, but I don't think starting your message with a "This is a mistake" is a good idea. It gets people's attention but both the OP's line and the line that you gave does compile. It also might be fine for someone in their first hour or two of C (and then the lecturer/teacher might show why it's wrong in the third hour and use it to explain casting).

                        – Ray
                        Nov 23 '18 at 4:25






                      • 1





                        Anyway, to the OP, I think you should take such advice carefully. If you are taking a class and start using std::lrint, your teacher might wonder who else are you asking for help. It's ok to be a "little" wrong when you're starting out; learning is a step-by-step process. But yes, if you want to hear the ending to the story, that's ok too!

                        – Ray
                        Nov 23 '18 at 4:27











                      • @Ray the Q/A on this site are for anyone to read, not just OP

                        – M.M
                        Nov 23 '18 at 6:14






                      • 1





                        I know. But your answer is given within the context of the OP's original question. Surely there's some compromise between providing information for anyone to read and sticking to the original OP's question.

                        – Ray
                        Nov 23 '18 at 15:14











                      • @Ray that's why multiple answers are allowed ...

                        – M.M
                        Nov 24 '18 at 1:19
















                      0














                      This is a mistake. In the code:



                      int a = b/c;


                      then it may cause undefined behaviour if the result of the division is a floating point value that is out of range of int (e.g. it exceeds INT_MAX after truncation). Compilers may warn about this if you use warning flags.





                      Changing the code to int a = (int)(b/c); has no effect on the behaviour of the code, but it may cause the compiler to suppress the warning (compilers sometimes treat a cast as the programmer expressing the intent that they do not want to see the warning).



                      So now you just have silent undefined behaviour, unless the previous code is designed in such a way that the division result can never be out of range.



                      A better solution to the problem would be:



                      long a = std::lrint(b/c);


                      If the quotient is out of range then this will store an unspecified value in a and you can detect the error using floating point error handling. Reference for std::lrint






                      share|improve this answer



















                      • 1





                        I understand what you're getting at, but I don't think starting your message with a "This is a mistake" is a good idea. It gets people's attention but both the OP's line and the line that you gave does compile. It also might be fine for someone in their first hour or two of C (and then the lecturer/teacher might show why it's wrong in the third hour and use it to explain casting).

                        – Ray
                        Nov 23 '18 at 4:25






                      • 1





                        Anyway, to the OP, I think you should take such advice carefully. If you are taking a class and start using std::lrint, your teacher might wonder who else are you asking for help. It's ok to be a "little" wrong when you're starting out; learning is a step-by-step process. But yes, if you want to hear the ending to the story, that's ok too!

                        – Ray
                        Nov 23 '18 at 4:27











                      • @Ray the Q/A on this site are for anyone to read, not just OP

                        – M.M
                        Nov 23 '18 at 6:14






                      • 1





                        I know. But your answer is given within the context of the OP's original question. Surely there's some compromise between providing information for anyone to read and sticking to the original OP's question.

                        – Ray
                        Nov 23 '18 at 15:14











                      • @Ray that's why multiple answers are allowed ...

                        – M.M
                        Nov 24 '18 at 1:19














                      0












                      0








                      0







                      This is a mistake. In the code:



                      int a = b/c;


                      then it may cause undefined behaviour if the result of the division is a floating point value that is out of range of int (e.g. it exceeds INT_MAX after truncation). Compilers may warn about this if you use warning flags.





                      Changing the code to int a = (int)(b/c); has no effect on the behaviour of the code, but it may cause the compiler to suppress the warning (compilers sometimes treat a cast as the programmer expressing the intent that they do not want to see the warning).



                      So now you just have silent undefined behaviour, unless the previous code is designed in such a way that the division result can never be out of range.



                      A better solution to the problem would be:



                      long a = std::lrint(b/c);


                      If the quotient is out of range then this will store an unspecified value in a and you can detect the error using floating point error handling. Reference for std::lrint






                      share|improve this answer













                      This is a mistake. In the code:



                      int a = b/c;


                      then it may cause undefined behaviour if the result of the division is a floating point value that is out of range of int (e.g. it exceeds INT_MAX after truncation). Compilers may warn about this if you use warning flags.





                      Changing the code to int a = (int)(b/c); has no effect on the behaviour of the code, but it may cause the compiler to suppress the warning (compilers sometimes treat a cast as the programmer expressing the intent that they do not want to see the warning).



                      So now you just have silent undefined behaviour, unless the previous code is designed in such a way that the division result can never be out of range.



                      A better solution to the problem would be:



                      long a = std::lrint(b/c);


                      If the quotient is out of range then this will store an unspecified value in a and you can detect the error using floating point error handling. Reference for std::lrint







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Nov 23 '18 at 4:17









                      M.MM.M

                      106k11120244




                      106k11120244








                      • 1





                        I understand what you're getting at, but I don't think starting your message with a "This is a mistake" is a good idea. It gets people's attention but both the OP's line and the line that you gave does compile. It also might be fine for someone in their first hour or two of C (and then the lecturer/teacher might show why it's wrong in the third hour and use it to explain casting).

                        – Ray
                        Nov 23 '18 at 4:25






                      • 1





                        Anyway, to the OP, I think you should take such advice carefully. If you are taking a class and start using std::lrint, your teacher might wonder who else are you asking for help. It's ok to be a "little" wrong when you're starting out; learning is a step-by-step process. But yes, if you want to hear the ending to the story, that's ok too!

                        – Ray
                        Nov 23 '18 at 4:27











                      • @Ray the Q/A on this site are for anyone to read, not just OP

                        – M.M
                        Nov 23 '18 at 6:14






                      • 1





                        I know. But your answer is given within the context of the OP's original question. Surely there's some compromise between providing information for anyone to read and sticking to the original OP's question.

                        – Ray
                        Nov 23 '18 at 15:14











                      • @Ray that's why multiple answers are allowed ...

                        – M.M
                        Nov 24 '18 at 1:19














                      • 1





                        I understand what you're getting at, but I don't think starting your message with a "This is a mistake" is a good idea. It gets people's attention but both the OP's line and the line that you gave does compile. It also might be fine for someone in their first hour or two of C (and then the lecturer/teacher might show why it's wrong in the third hour and use it to explain casting).

                        – Ray
                        Nov 23 '18 at 4:25






                      • 1





                        Anyway, to the OP, I think you should take such advice carefully. If you are taking a class and start using std::lrint, your teacher might wonder who else are you asking for help. It's ok to be a "little" wrong when you're starting out; learning is a step-by-step process. But yes, if you want to hear the ending to the story, that's ok too!

                        – Ray
                        Nov 23 '18 at 4:27











                      • @Ray the Q/A on this site are for anyone to read, not just OP

                        – M.M
                        Nov 23 '18 at 6:14






                      • 1





                        I know. But your answer is given within the context of the OP's original question. Surely there's some compromise between providing information for anyone to read and sticking to the original OP's question.

                        – Ray
                        Nov 23 '18 at 15:14











                      • @Ray that's why multiple answers are allowed ...

                        – M.M
                        Nov 24 '18 at 1:19








                      1




                      1





                      I understand what you're getting at, but I don't think starting your message with a "This is a mistake" is a good idea. It gets people's attention but both the OP's line and the line that you gave does compile. It also might be fine for someone in their first hour or two of C (and then the lecturer/teacher might show why it's wrong in the third hour and use it to explain casting).

                      – Ray
                      Nov 23 '18 at 4:25





                      I understand what you're getting at, but I don't think starting your message with a "This is a mistake" is a good idea. It gets people's attention but both the OP's line and the line that you gave does compile. It also might be fine for someone in their first hour or two of C (and then the lecturer/teacher might show why it's wrong in the third hour and use it to explain casting).

                      – Ray
                      Nov 23 '18 at 4:25




                      1




                      1





                      Anyway, to the OP, I think you should take such advice carefully. If you are taking a class and start using std::lrint, your teacher might wonder who else are you asking for help. It's ok to be a "little" wrong when you're starting out; learning is a step-by-step process. But yes, if you want to hear the ending to the story, that's ok too!

                      – Ray
                      Nov 23 '18 at 4:27





                      Anyway, to the OP, I think you should take such advice carefully. If you are taking a class and start using std::lrint, your teacher might wonder who else are you asking for help. It's ok to be a "little" wrong when you're starting out; learning is a step-by-step process. But yes, if you want to hear the ending to the story, that's ok too!

                      – Ray
                      Nov 23 '18 at 4:27













                      @Ray the Q/A on this site are for anyone to read, not just OP

                      – M.M
                      Nov 23 '18 at 6:14





                      @Ray the Q/A on this site are for anyone to read, not just OP

                      – M.M
                      Nov 23 '18 at 6:14




                      1




                      1





                      I know. But your answer is given within the context of the OP's original question. Surely there's some compromise between providing information for anyone to read and sticking to the original OP's question.

                      – Ray
                      Nov 23 '18 at 15:14





                      I know. But your answer is given within the context of the OP's original question. Surely there's some compromise between providing information for anyone to read and sticking to the original OP's question.

                      – Ray
                      Nov 23 '18 at 15:14













                      @Ray that's why multiple answers are allowed ...

                      – M.M
                      Nov 24 '18 at 1:19





                      @Ray that's why multiple answers are allowed ...

                      – M.M
                      Nov 24 '18 at 1:19


















                      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%2f53439424%2fwhy-would-int-precede-an-assignment-in-c%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







                      這個網誌中的熱門文章

                      Post-Redirect-Get with Spring WebFlux and Thymeleaf

                      Xamarin.form Move up view when keyboard appear

                      JBPM : POST request for execute process go wrong