Programming with C: Do not allow third-party variables to be created

Source: Internet
Author: User

In- depth understanding of XOR operation Instances

I. Code IMPLEMENTATION

#include <stdio.h> int main () {int a = 10;    int B = 12;    A = A^b;    b = a^b;    A = A^b;    printf ("%d%d", A, b);    System ("pause");    return 0; }

two. Heterogeneity or nature

Each element is its own additive inverse (a^a = 0)

Three. Compilation analysis

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7A/D8/wKiom1a-4e3AMag_AAAseGbNtco084.png "title=" 1.PNG " alt= "Wkiom1a-4e3amag_aaasegbntco084.png"/>

1. Remove the values of a and B

2. Place the value of a in eax, and B and eax, and save the value of a.

3. Place the value of a in eax, Xor B with eax, and save the value of B.

4. Place the value of a in eax, and B and eax, and save the value of a.

The concept of A^a = 0 was used;



This article is from the "make a small driver" blog, please be sure to keep this source http://10799170.blog.51cto.com/10789170/1741808

Programming with C: Do not allow third-party variables to be created

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.