Explain, artifice the most fiery answer to the C language.

Source: Internet
Author: User

A few days ago, I happened to find a very fire problem.

"What is the artifice of C language?" "Although the problem itself is nothing special, but the Netizen's answer is very humorous."

Let's look at the most-liked answers below. "C-language operators tend to '--".

I believe all the friends who have studied C are aware that there is no '---' operator in C.

So why do users say that the program can run it?

In fact, '--' is the combination of operator '--' and ' > '.

Since ' > ' priority is greater than '-', the order of execution for X--0 should be as follows:

First x > 0

In X--

After the above analysis, the above code can actually be written as follows.

#include <stdio.h>int  main () {    int;      while 0 )    {        x--;        printf ("", x);    }     return 0 ;}

Finally, attach the result of the operation:

Thank you for reading.

Explain, artifice the most fiery answer to the C language.

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.