Tag Archives: casting

Celebrating 10 years – my top 10 blog articles

Technical Consultant at Feabhas Ltd
Glennan is an embedded systems and software engineer with over 20 years experience, mostly in high-integrity systems for the defence and aerospace industry.

He specialises in C++, UML, software modelling, Systems Engineering and process development.
Glennan Carnie

It’s difficult to believe we’ve been writing articles for 10 years.  In that time I’ve written over 90 technical articles on C, C++ and embedded system design.

To celebrate I’ve picked my ‘Top 10’ articles, with a little background into why I enjoyed writing them so much, or the story behind them.

So, sit back, cue up “At the Sign of the Swinging Cymbal“* and enjoy.

 

(* This really dates

Posted in C/C++ Programming, Design Issues, Testing, UML | Tagged , , , , , , , | Leave a comment

Casting – what could possibly go wrong?

Technical Consultant at Feabhas Ltd
Glennan is an embedded systems and software engineer with over 20 years experience, mostly in high-integrity systems for the defence and aerospace industry.

He specialises in C++, UML, software modelling, Systems Engineering and process development.
Glennan Carnie

Type casting in C++ is a form of what is known in computer science as type punning – that is, circumventing the type system of a programming language.

C++ inherits its conversion and casting mechanism from C, but supplements it (although sensibly we should say, replaces it) with four, more explicit cast operations:

static_cast
reinterpret_cast
const_cast
dynamic_cast

In C and C++ – and particularly in embedded systems – casting is a necessary evil; so much so that many programmers just accept it […]

Posted in C/C++ Programming, Design Issues | Tagged , , , , , | 1 Comment