Modulinos: Difference between revisions

Content added Content deleted
(Added LLVM)
Line 5: Line 5:


=={{header|C}}==
=={{header|C}}==
C programs have scripted main by default; as long as main() is not included in the header file, this program's (empty) API is accessible by other C code.
C programs cannot do scripted main, because main() is implicitly included by another program, test.c, even when scriptedmain.h is empty.


scriptedmain.h is blank; it is included in order to show that if another C file, test.c, includes scriptedmain, scriptedmain's main() is not executed.
The following example will not work with another program, test.c, due to duplicate main() functions at compile time.


<lang c>#include "scriptedmain.h"
<lang c>#include "scriptedmain.h"
Line 31: Line 31:
return 0;
return 0;
}</lang>
}</lang>



=={{header|C++}}==
=={{header|C++}}==