iOS Development Learning Record the 6th day of C language learning-----comma expression

Source: Internet
Author: User

the introduction and use of the comma expression

1. Concatenate multiple expressions to form an expression, usage: expression 1, expression 2, expression 3, expression N... Returns the value of the last expression

Example:

#include <stdio.h>int main (int argc, const char * argv[]) {    int a=2,b=3,c=4,x=0,y=0,z=0,result=0;    result= (x=a+b,y=b+c,z=x+y);//At this time x=2+3,y=3+4,z=5+7    printf ("x=%d,y=%d,z=%d", X, Y, z);//5,7,12    printf (" The value of the last result is:%d ", result);//result takes the value of the last expression, which is both        return 0;}

iOS Development Learning Record the 6th day of C language learning-----comma expression

Related Article

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.