Category Archives: C++

Evils of typedefs and legacy code

Our legacy C++ codebase once was a C codebase.  Way back then, there was no standard boolean type.  So in the wisdom of the day a type was declared typedef int tBool; The major problem with tBool’s is that over … Continue reading

Posted in C++, Programming | Leave a comment

#pragma pack()

I have just spent the last hour bashing my head, trying to workout why some new C++ code (to my project) was crashing. I was constructing one class, and it was building some worker classes and crashing in the std::vector … Continue reading

Posted in C++, Programming | 1 Comment

Lint, the best thing for your C/C++ code

I was first introduced to PC-Lint at my old company, after complaining about code style and the state of the software after having warnings turned off for years to a co-worker.  I then spent a few months evaluating the software and removing … Continue reading

Posted in C++, Programming, Software | 1 Comment

Programming Challenges:110502 Reverse and Add

I solved the 110502 Reverse and Add problem today. The hardest part was whipping up the worker functions to do text based numbers. I started by laying out the algorithm in function blocks, then proceeded to full in the gaps. I had … Continue reading

Posted in C++, Programming | Tagged | Leave a comment

C++ Default Constructors

Well the bug I was getting bitten by at work is shown by the following code. With a break point on the return (in debug mode). Inspection shows the 8 variables have the follow values: now v1-v4 are what I’d … Continue reading

Posted in C++ | Leave a comment