diff --git a/readme.md b/readme.md index 58cd1bd..8bf4dee 100644 --- a/readme.md +++ b/readme.md @@ -79,7 +79,7 @@ directory, and for more in-depth look at the language, the unit tests in the "unittests" directory cover the most ground. For examples of how to register parts of your C++ application, see -"example.cpp" in the "src" directory. Example.cpp is verbose and shows every +"example.cpp" in the "samples" directory. Example.cpp is verbose and shows every possible way of working with the library. For further documentation generate the doxygen documentation in the build folder or see the website http://www.chaiscript.com. @@ -87,21 +87,21 @@ http://www.chaiscript.com. The shortest complete example possible follows: - /// main.cpp +```C++ +/// main.cpp - #include +#include - double function(int i, double j) - { - return i * j; - } - - int main() - { - chaiscript::ChaiScript chai; - chai.add(chaiscript::fun(&function), "function"); - - double d = chai.eval("function(3, 4.75);"); - } +double function(int i, double j) +{ + return i * j; +} +int main() +{ + chaiscript::ChaiScript chai; + chai.add(chaiscript::fun(&function), "function"); + double d = chai.eval("function(3, 4.75);"); +} +```