What does "#include <sndfile.h>
" mean? (Sorry I'm c\c++ nub)
By the way I know ActionScript and HTML.
What does "#include <sndfile.h>
" mean? (Sorry I'm c\c++ nub)
By the way I know ActionScript and HTML.
The #include directive tells the preprocessor to treat the contents of a specified file as if those contents had appeared in the source program at the point where the directive appears.
#include "path-spec"
#include <path-spec>
The path-spec is a filename optionally preceded by a directory specification. The filename must name an existing file. The syntax of the path-spec depends on the operating system on which the program is compiled.
You can organize constant and macro definitions into include files and then use #include directives to add these definitions to any source file. Include files are also useful for incorporating declarations of external variables and complex data types.
You need to define and name the types only once in an include file created for that purpose.
That is a preprocessor directive to include the header file called 'sndfile.h'. Basically it means include the contents of that file in the place of that directive, which will usually give you function definitions for an object file that will be linked with your source code, and often defines constants, etc....
See wikipedia
Well, in layman's terms, it means in this very specific case:
I am going to use the functions and data structures provided by sndfile.h, which happens to be the header file for libsndfile: http://www.mega-nerd.com/libsndfile/api.html
#include XXX
means, as stated above, to include the contents of XXX as if they had been copied and pasted into the source code before any other compilation steps.
XXX can be in <brackets>
or "quotes". The <bracketed>
files are searched for on a system path and the "quoted" files on a user path.
How these are paths are defined will vary depending on your compiler and build system. It is common for compilers to allow users to override this search logic but it is still a good discipline to use "quotes" for your own headers and <brackets>
for system.
A preprocessing directive of the form
# include <h-char-sequence> new-line
searches a sequence of implementation-defined places for a header identified uniquely by the specified sequence between the < and > delimiters, and causes the replacement of that directive by the entire contents of the header. How the places are specified or the header identified is implementation-defined.
#include <sndfile.h>
is a preprocessor command, which essentially translates to "Take the contents of the file sndfile.h, and paste them into this file right here."
Usually used to bring in function definitions from external libraries or other source files, so they can be accessed without having to recompile the entire codebase. By putting the common definitions in their own small header file, it can be included into as many source files as necessary. This way, only the one file would need to be updated whenever a change is made, rather than having to modify all source files that use that library.