inline functions (Inline function)

Source: Internet
Author: User

inline function
Instead of a control transfer at the time of the call, the inline function embeds the function body at every call at compile time.
The syntax of the introverted function:

Inline type descriptor called function name (including formal parameter list with type description) {function body statement};
using function Body considerations
1 The internal function can not have circular statements and switch statements in general
2 the definition of an inline function must appear before the first call
3) An inline function cannot be declared with an exception interface
Custom data types
typedef declaration
typedef double Area,volumn;
Area and Volum become nicknames for Double, which you can use as a double as a keyword.
enumeration Type (enum)
Enum Game_result{win,lost,tie,cancel};
Game_result omit=cancel;//or enum Game_result omit=cancel;
When declaring a variable, you can not write the keyword enum.
Structural Body
A struct combines different types of data into a whole to describe an object. It is not enough to declare a struct type, but to use the structural body data, and to declare a struct variable.
Consortium
Sometimes, you need to use several different types of variables to share the same set of certificates, and you can declare a federation type.

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.