C-Language Foundation small Vegetarian

Source: Internet
Author: User

One. Relational operators

Relational operators, which are important in C and mainstream languages, are used to compare operations. Includes more than (>), less than (<), equals (= =), greater than or equal (>=), less than or equal to (= =), and not equal to (! =) Six symbols.

Of course, the expression that is connected by the conditional operator is set, we say its result is true. (the C language mentioned above is true for non-0)

The result of the relational operation in C language. True "1", False for "0":

int 6 5 // a = 1; int 5 6 // a = 0;

Two. Logical operators

Logical operators include:

* Logic and &&

* Logic or | |

* Logical Non!

The result of the logical operator is also two, which is really "1", false "0"

Three. Conditional operators

Namely: three mesh operation; it is expressed in the following form:

  variable = expression 1? Expression 2: Expression 3

Expression 1 is true, the result is an expression of 2, the expression 1 is false, and the result is an expression of 3

Four. sizeof

sizeof can be used to calculate the number of bytes of memory that a constant, variable or data type occupies. The written form is sizeof ();

C-Language Foundation small Vegetarian

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.