C language syntax

Source: Internet
Author: User

I only know after work. It turns outC LanguageI am still so unfamiliar. I only know some common usage, but I am not clear about Some uncommon ones. From today on, I will start to sort them out!

Typedef

TheFormulaTo follow is: typedef [attributes] datatype aliasname;

Example:

Typedef short smallnumber;
Typedef unsigned int positive;
Typedef double * pdouble;
Typedef string fivestrings [5];

Mean:

In typedef short smallnumber, smallnumber can now be used as a data type to declare a variable for a small integer.
In the second example, typedef unsigned int positive, the positive word can then be used to declare a variable of an unsigned int type.
after typedef double * pdouble, the word pdouble can be used to declare a pointer to double.
by defining typedef string fivestrings [5], fivestrings can be used to declare an array of 5 strings with each string being of Type string.

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.