<P> One drawback of this method is that the prototype must be present in all files that use the function . Another drawback is that if the return type or arguments of the function are changed, these prototypes will have to be updated . Putting the prototype in a single, separate file avoids these problems . Assuming the prototype is moved to the file add. h, the second source file can then become: </P> <P> Now, every time the code is compiled, the latest function prototypes in add. h will be included in the files using them, avoiding potentially disastrous errors . </P> <P> In C and C++, the #include preprocessor directive causes the compiler to replace that line with the entire text of the contents of the named source file (if included in quotes: "") or named header (if included in angle brackets: <>); note that a header need not be a source file . Inclusion continues recursively on these included contents, up to an implementation - defined nesting limit . Headers need not have names corresponding to files: in C++ standard headers are typically identified with words, like "vector", hence #include <vector> while in C standard headers have identifiers in the form of filenames with a ". h" extension, as in #include <stdio. h>. A "source file" can be any file, with a name of any form, but is most commonly named with a ". h" extension and called a "header file" (sometimes ". hpp" or ". hh" to distinguish C++ headers), though files with . c, . cc, and . cpp extensions may also be included (particularly in the Single Compilation Unit technique), and sometimes other extensions are used . </P> <P> These two forms of #include directive can determine which header or source file to include in an implementation - defined way . In practice, what is usually done is that the angle - brackets form searches for source files in a standard system directory (or set of directories), and then searches for source files in local or project - specific paths (specified on the command line, in an environment variable, or in a Makefile or other build file), while the form with quotes does not search in a standard system directory, only searching in local or project - specific paths . In case there is no clash, the angle - brackets form can also be used to specify project - specific includes, but this is considered poor form . The fact that headers need not correspond to files is primarily an implementation technicality, and used to omit the . h extension in including C++ standard headers; in common use "header" means "header file". </P>

What is the use of include in c++