Skip to content
Archive of posts filed under the C++ category.

X Windows Programming in C++: Part II

X Windows Programming in C++: Part I Continuing with our task of creating a C++ version of basicwin.c, we next look at XOpenDisplay / XCloseDisplay. Here’s some code snippets from basicwin.c showing the use of these functions:

X Windows Programming in C++: Part I

Years ago, I did quite a bit X Windows programming. When I started developing X Windows software, I was also learning C++ (this was a long time ago). Unfortunately , the X Windows system I was developing software for did not have a C++ compiler. This led to some frustration since using C++ would have [...]

C++ Functions to Evaluate Legendre Polynomials

Here’s some C++ functions which evaluate Legendre polynomials: P0(x): double P0(double x) ; P1(x): double P1(double x) ; P2(x): double P2(double x) ; Pn(x): double Pn(unsigned int n, double x) ; These are inline functions defined in the header file, legendre.h:

An Interview Question

Here’s some code stolen from The Daily WTF: ushort GetAsciiValue (uchar ch) { ushort i; for (i=0; i<=255; i++) { if(ch == i) return i; } return 0; } It might be interesting to show this code to a candidate for a C/C++ position. Ask him/her if there is anything wrong with this code, and [...]

Matrix Template Library

While rewriting some data analysis software I developed many years ago (the original was written in K & R C, the new version will be written in C++), I stumbled upon The Matrix Template Library (MTL). MTL is a library that provides comprehensive linear algebra functionality for a wide variety of matrix formats. I was [...]