simon's blog

Dynamic multidimensional arrays in C++


today I had to code something like this:

  1. unsigned int var1; unsigned int var2;
  2. char **myArray = new char[var1][var2];

As you probably know, no C++ compiler is going to accept this; there will be an error about some non constant value as second array dimension. (g++ delivers: ... error: ‘numOfCols’ cannot appear in a constant-expression)

Ok, the straight forward solution would be to use a STL container, for example:

  1. std::vector< std::vector<char> >

But I'm having a special case where I really do not want to use the STL containers. Luckily enough, there's a solution:

  1. #include <iostream>
  3. using namespace std;
  5. class ArrayTest{
  6. public:

Doxygen (Pango) troubles with freefont-package


today I installed a few additional font packages to my OpenSUSE 11.0 installation and as a result my previously fine doxygen setup produced a lot of these error messages:
(process:5170): Pango-WARNING **: Error loading GPOS table 5503
(It seems to be a bug in pango; see for example (id=540617) and (id=528272).)

Some hints on the CuTe C++ Unit Testing


I just had some minor problems getting started with CuTe ( since the documentation on didn't match the reality of the version I'm using.

If you're using Eclipse, a slight adjustment needs to be done to the includes:

  1. #include "cute/cute_runner.h"
  2. #include "cute/cute_counting_listener.h"
  3. #include "cute/eclipse_listener.h"

To setup your tests, you've got to write something like:

  1. void runTest()
  2. {
  3.    cute::suite s;
  4.    s.push_back(CUTE(myObject->testFunc));

OpenSUSE 11 on Asus X50N Notebook

I've been waiting for OpenSUSE 11 to install it on my notebook for a while hoping that 11 would solve my WLan issues. Here are some first impressions:

WLan: It finally works although it needs some tweaking. For my WLan I need WPA2 which is supported by the on board NIC. Unfortunately, neither the ath5k nor the ndiswrapper driver manage to get it working, both of them fail during the 4-way handshake. Even more frustrating is the fact, that the 'official' madwifi-kmp package doesn't match the kernel and thus can't be installed. (I guess, they'll fix it soon.) But there's a solution (as root):

Syndicate content (C01 _th3me_)