What does =+ mean in C?

后端 未结 6 1657
说谎
说谎 2020-11-30 08:30

I came across =+ as opposed to the standard += today in some C code; I\'m not quite sure what\'s going on here. I also couldn\'t find it in the doc

6条回答
  •  一整个雨季
    2020-11-30 08:57

    I think

    a =+ 5;
    

    should be equivalent to

    a = (+5);
    

    and therefore be code of very bad style.

    I tried the following code and it printed "5":

    #include 
    using namespace std;
    
    int main()
    {
        int a=2;
        a =+ 5;
        cout << a;
    }
    

提交回复
热议问题