Inline functions and macro definitions

Source: Internet
Author: User

differences between inline functions and macro definitions
Inline functions can speed up the program when compared to normal functions because no interrupt calls are required, and inline functions are embedded directly in the target code at compile time, and the macro is simply a replacement.
Inline functions need to be checked for parameter types, which is the advantage of inline functions and macro ratios
Inline refers to the embed code, that is, where the function is called without jumping, but directly to write the code there. For short code, inline increases the amount of space consumed in exchange for increased efficiency. Inline is safer when compared to macros without paying an extra price,
Inline is generally used for the following situations:
(1) A function is repeatedly reused
(2) The function has only a few simple lines, and the function does not contain for,while,switch

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.