Byexamples - cc.byexamples.com - c/c++ programming by examples

Latest News:

Lua stack dump for c++ 20 Nov 2008 | 12:07 am

Any interactions between c++ and lua are going through lua stack. Aware of the stack status may help for debugging. I always do that, will a peek of the current Lua stack not only helps me debug my co...

Static Linking Compilation for Boost C++ Libraries 16 Aug 2008 | 02:48 pm

Boost C++ Libraries provides a set of peer-reviewed portable C++ source libraries. As we know, coding in c++, there are a lots of things we need to write it from scratch, we need to create a common so...

Calling Lua function from C++ 16 Jul 2008 | 01:28 am

Calling Lua function from c++ is very simple. Value passing between c++ and Lua goes through stack, Lua C API provides a convenience ways for you to call Lua function from C. To call Lua function, you...

calling c++ function from Lua, implement sleep function 6 Jul 2008 | 05:38 pm

You can’t call c function directly from Lua, you have to create a wrapper function that allows calling from Lua. In this post, shows a simple example to implement millisecond sleep function to Lua usi...

Accessing Lua global variables from c++ 21 Jun 2008 | 07:09 am

Calling Lua scripts from c++’s example was written in post How to embed Lua 5.1 in C++. Now, let us look at how to access Lua’s global variables from c++. Value passing between c++ and Lua rely on Lua...

GNU readline: Implement Custom Auto-complete 16 Jun 2008 | 05:55 am

GNU readline implement filename auto-complete by default, it will list all the files in the current directory. We can disable it by binds our TAB key to some other operation. In previous post, I simpl...

gnu readline: How to keep a history list of entered command lines 14 Jun 2008 | 03:26 am

When I was assigned a project to create a text console based simulator, I am looking into how to keep a history list of entered command lines like Bash Shell. Users are allow to search through the his...

STL Singleton Template 9 Jun 2008 | 11:30 am

Singleton is one of my favorite design pattern, I use it to keep a global information for my application such as Configurations, Logger etc. I remember I wrote a post regarding simple singleton class,...

How to embed Lua 5.1 in C++ 8 Jun 2008 | 02:13 am

Lua, is a scripting language providing dynamic data structures, maths, io and string manipulations just like any interprete language such as Bash, Python, Ruby etc. What is so special about Lua? Lua i...

simple callback function 12 Oct 2007 | 02:30 am

Callback function is hard to trace, but sometimes it is very useful. Especially when you are designing libraries. Callback function is like asking your user to gives you a function name, and you will ...

Recently parsed news:

Recent searches: