Preprocessors

The preprocessors are executed before the program is compiled.

#Include

Includes other source file into current source file at the line immediately after the directive.

if an include folder is specified when compiling the C-- using the -i flag, the file located in the previous folder can be include without adding the entire path.

Circular dependencies are forbidden so you can not include a file that include the current one.

Synopsis

(#include <filename>)

Examples

(#include ./lib.cmm)
(func (test (int c))
{
    (c);
})
(test 2)

We can see that we include the file lib.cmm this file contains the function factorial which is use in the function test.

If we had not include the file lib.cmm, the previous code would not run.

Last updated