Hybrid Cars

The regular Honda Civic gets 40mpg highway and costs $17,000.The hybrid Honda Civic gets 50mpg highway and costs $22,000. At $2.75/gallon for gas, the hybrid costs $0.01375 less per mile. Since the hybrid is $5,000 more, you’ll need to drive about 360,000 miles before the hybrid will actually start saving

Read More »

C++ inheritance ambiguity

Here’s something fun I discovered today: class a {public: class b { public: virtual void dosomething() = 0; };}; class c : public a::b {public: class b { public: virtual void dosomethingelse() = 0; }; void dosomething() {}}; class d : public c::b {public: void dosomethingelse() { printf (“do something

Read More »

Where did my C/C++ settings go in Visual Studio?

This is crazy! A while ago I noticed that the “C/C++” settings block in one of my Visual Studio projects disappeared. I couldn’t change any compilation settings in my project unless I made the changes on a per-file basis, which is really annoying when your project has over a hundred

Read More »