In C++, you can declare a variable in a derived class with the exact same name as the base class. This is allowed because each variable is properly scoped. Shadowing can lead to some fairly unpredictable behavior. Consider a class…
In C++, you can declare a variable in a derived class with the exact same name as the base class. This is allowed because each variable is properly scoped. Shadowing can lead to some fairly unpredictable behavior. Consider a class…
One of the frustrating aspects of programming in C++ is memory management. In Java this is, in large part, handled by the garbage collector. As long as you don’t keep references lying about that you don’t need, and the GC…
I do lot of my development in C++. It’s not the most user-friendly of languages but it’s very powerful. Learning it can be a bear, however. If you’re really a glutton for punishment, you could start with The C++ Programming…
If you run into a compiler error like this compiling a template on HP 11.00: Error 419: “myfile.cpp”, line 5 # ‘iterator’ is used as a type, but has not been defined as a type. std::vector::iterator j; you need to…
I recently had to get user information from a NIS domain programmatically. It’s fairly simple to dump the NIS database from the command line using ypcat. e.g. It’s just as easy to match users or UIDs using ypwhich. e.g. Unfortunately,…
The Solaris compiler suite ships with dbx, a source level debugger. Later versions include additional functionality to detect memory leaks and dangling blocks at program exit. The Sun guys once again designed a pretty powerful tool with a god awful…
The CORBA object semantics are really frustrating at times. They behave close enough to how C++ does things to make them familiar, but they differ enough to lull you into a false sense of familiarity. Your first attempt to return…
Suppose you’re following the “resource acquisition is initialization” technique where you allocate resources as part of construction. You might write classes like: The resource is allocated in the constructor when the object is instantiated and released in the destructor when…