Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the best practice for #include notation, and why?

best notation Practice
0
Posted

What is the best practice for #include notation, and why?

0

Using quote delimiters in #include statements hard-codes file location information in your source code files. Consequently, to change file locations you then have to edit the source code files with a new location for the included files. In general, hard coding specific info like this in the source code is not best practice. It spreads out information that should be collected in a single place. The place where file locations should be recorded is in the project manager. To make this work you always use the angle bracket delimiters for #include statements. The effect is to uncouple include file location from the source code file and move it up into the project manager. In an IDE, access to the manager is via some feature like “add path” (.net) or “add to project” (eclipse). If you could see under the hood of an IDE, you would find a makefile. The manager we are using is explicit and decoupled from the text editor: the make utility. The project makefile is the place where we record how th

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123