Learning C + + need to pay attention to the problem __c++

Source: Internet
Author: User

#include the difference between "A.h" and #include<a.h>: The first is that the compiler will start looking for this file from the current working directory, which means the compiler starts looking for this file from the standard library directory

The role of the header file:

enhance security detection; You can easily invoke library functionality through header files without having to care about how they are implemented

Position of *,& modifier:

To avoid misunderstanding, it is best to place it immediately next to the variable name

C + + is worth the delivery way:

There are three ways: value passing, pointer passing, reference passing

void Fun (char c);
void Fun (CHAR*STR);
void Fun (CHAR&STR);
If the input parameter is passed as a value, it is preferable to use a reference pass instead because the reference pass eliminates the construction and destructor of the temporary object

The function type cannot be omitted, even if it is not added void



Attached links, free to continue to click on the Open link

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.