About C++ and WhiskerClientLib

Top  Previous  Next

Learning C++

 

If you would like to learn C++, I [RNC] suggest you get a good compiler. The compiler is the program that converts the source code (in textual format) into an executable program, finding your typing mistakes along the way. There are some pretty good free C++ compilers; one is DJGPP, available at http://www.delorie.com/djgpp/. Mind you, if you're in an academic environment you can get a very cheap version of Microsoft Visual C++ 6.0 Professional, which is what I use.

 

In addition, you'll want a book or an electronic tutorial. Bear in mind that most books on learning Visual C++ (Microsoft's product) are concerned more with Windows programming than on the language itself, but you should start with a plain C++ tutorial. I'm not sure what the best one for beginners currently is. The definitive reference is Stroustrup (1997), The C++ Programming Language (3rd Edition), though the book is oriented towards programmers with some experience. Stroustrup created C++ (see also http://www.research.att.com/~bs/). There are additional literature references at the end of this Guide.

 

Building programs in C++

 

The actual process depends on the compiler. If you have loaded a workspace into Visual C++, you can press F7 to compile the application, and Ctrl-F5 to run it.

 

An introduction to WhiskerClientLib

 

Several of the C++ clients supplied with Whisker (including SimpleCPPClient, WhiskerStatus and SecondOrder) use the WhiskerClientLib library. A library is a collection of code to perform certain functions; its purpose is to save you reinventing the wheel. In the case of WhiskerClientLib, the library contains a set of routines that automate connecting to and communicating with the server and also assist in the creation of behavioural tasks. More detail is given later.

 

If you want to change and rebuild SimpleCPPClient, see also the notice regarding Debug and Release modes.

 

Comments on the suitability of C++

 

C++ is a general-purpose programming language; as such, you can do pretty much anything in it. If it's not obvious from the rest of this guide, it's my [RNC] favourite programming language.