stevedoria.net

practicing safe hex since '87

Archive for the 'C++' Category

Exceptions vs. Error Return Codes

April 26th, 2019 Posted in C#, C++, Software Engineering | Comments »

I have been partly responsible for maintaining legacy source code. Almost all of the code is implemented in C and therefore does not use exceptions. Much of the error handling code follows the following pattern here implemented in C++ (imagine in this example, operator new returns 0 when no memory is available): int function() { […]

How to Install GCC 7 on CentOS 7

February 14th, 2018 Posted in C++, IT Administration | 1 Comment »

Interested in keeping up with the latest C++ standard, I noticed that CentOS 7.4.1708 uses gcc version 4.8.5 20150623. This version of gcc defaults to ISO/IEC 14882:1998. Updated C++ standards have been released in 2003, 2011, 2014, and 2017. Although gcc developers are still implementing the 2017 standard, it is good to use a recent […]

Data Hiding in C

March 2nd, 2008 Posted in C++, Software Engineering | 4 Comments »

Object-oriented programming languages are described as supporting encapsulation, polymorphism, and data hiding. They provide powerful features that allow software components to be designed and implemented for change. Observing the mechanisms in an object-oriented programming language can potentially lead to a parallel implementation in a procedural language. This allows some object-oriented design knowledge that has been […]

Functions, Parameters, and Global Variables in C

February 4th, 2008 Posted in C++, Software Engineering | Comments »

When I define interfaces to the functions that I implement, I try to be explicit about the variables that the functions will examine and modify. From time to time, a global variable is necessary, and I typically employ intermediary functions for accessing such a variable. Avoiding the direct use of global variables within functions is […]

Differences between C++ Classes and Structs

September 13th, 2005 Posted in C++ | 78 Comments »

Probably the most frequently asked interview question that I have received is one that explores the difference between C++ classes and structs. Such a question was asked by a Northrop Grumman recruiter during a career fair at UC Irvine. I was also asked this sort of question during an on-site interview at Heavy Iron Studios. […]