# Use and difference between include and add project files in FileView (simplified ClassView)

Source: Internet
Author: User

 

# Include <File> or # include "file" indicates adding a system file or adding a directory file. Most of the files added here are ". h "the ending file. This is what we often call the header file. Adding this file is mainly used for connection during compilation". cpp is used in the file. In fact, what we use is ". cpp "file, so during VC compilation, you will see that the compiler compilation file process shows that the compilation is often". cpp file.

 

Add project files in FileView. We often add ". h "and". cpp "file, in fact, this is a very formal way to add project files, but often added to the project file too much, especially in a". h "file contains many struct declarations, which will display many classes in your" ClassVeiw "(struct is also displayed as a class ), this will add a lot of visual and search burden to your project. It seems that this project is very "bloated" and is difficult to manage.

 

Some people think, can they "Remove" (hide) some existing classes and struct without affecting the project?

There are some solutions, so we need to understand the compilation requirements of the "# include" and VC compilers.

 

Two points:

I. # use ". h "file,". h. cpp "file,". h "file can be searched in the system directory or user-specified directory, but". cpp"

The file cannot be specified by the user, and must be linked and compiled by the ". h" file.

2. The ". cpp" file will be called during compilation. It is required for the project runtime. Therefore, the ". cpp" file must be loaded into the project.

 

From the above two points, we can see that # The include file can be set by the user, so that the compiler can search by themselves, ". cpp files must be loaded into the project. Therefore, you do not need to add the project files in FileView. h "file, so that the" ClassView "interface will not cause bloated images, but". cpp files must be added.

 

OK, so that your ClassView will be greatly simplified.

 

Author: weiqubo

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.