what *p1 ^= *p2; does in c

后端 未结 4 854
别那么骄傲
别那么骄傲 2021-01-29 06:09

In C what does this statement do?

*p1 ^= *p2;

p1 and p2 are char pointers pointing to two different address of a char

4条回答
  •  春和景丽
    2021-01-29 06:26

    When apply ^ on char variable, just regard it as int.

    define VALUE 11
    char c = VALUE;
    int i = VALUE;
    

    Cause you can think that the value of c or i are same in memory.

提交回复
热议问题