Programming Pointers

IMG2

Dan Saks, a widely recognized expert in C and C++, offers tips and techniques to embedded developers.

Return to Embedded.com home page.



Unexpected trends

Dan Saks

5/2/2012 6:24 PM EDT

Dan Saks crunches over 12 years of data on programming-language preferences from reader studies and finds some surprises about C/C++.


Join  post comment   14 comments    last comment  lwriemen
The same can be said for Executable UML models as well, but the poll doesn't show much adoption in ...

Virtual functions in C++

Dan Saks

4/4/2012 1:21 PM EDT

Class derivation and virtual functions let you define a common interface for related classes with similar, yet distinct, behaviors.


Join  post comment   4 comments    last comment  Luis Sanchez
Looks like there's still is a lot to learn about C++. I think I already heard before about Virtual ...

Discriminated unions

Dan Saks

2/27/2012 12:14 PM EST

Discriminated unions can be useful in some applications, but they also provide insight into the advantages of using virtual functions.


Join  post comment   6 comments    last comment  DickH
this is common to all OOP languages - a class KNOWS which class it is, what kind of object an ...

Judgment calls

Dan Saks

12/6/2011 4:02 PM EST

Writing better hardware interfaces may require writing fairly elaborate declarations. It's probably worth the effort.


Join  post comment   20 comments    last comment  Dan_Saks
That 0x12 should have been just 12. Thanks for catching the typo.

Using member new to map devices

Dan Saks

11/18/2011 10:00 AM EST

Declaring operator new as a class member can be a handy way to provide guaranteed initialization for memory-mapped objects.


Join  post comment   14 comments    last comment  lonewanderer
I use a chip that has 6 identical UARTs that differ only in the base address of the memory mapped ...

Calling constructors with placement new

Dan Saks

8/31/2011 1:50 PM EDT

New with placement offers C++ developers explicit control over how and when to initialize memory-mapped objects.


Join  post comment   16 comments    last comment  SWKoder
It seems like this solution is overly complex. Why not use the constructor's initializer list? This ...

Difficulties constructing memory-mapped objects

Dan Saks

7/29/2011 7:21 PM EDT

Defining constructors for classes representing memory-mapped devices is a good idea, if only you could get those constructors to run automatically.


Join  post comment   14 comments    last comment  wdwinder
Im not following how placing the entire class at a specific location is getting the memory mapped ...

Using member initializers

Dan Saks

6/1/2011 12:09 PM EDT

Using member initializers offers more control over what constructors do, and helps eliminate unnecessary default initialization.


Join  post comment   4 comments    last comment  tbakshi
Also , apart from initializing const member data variables which could not be done without member ...

Insights into member initialization

Dan Saks

4/27/2011 7:27 PM EDT

Often when it seems that C++ is generating bigger and slower code than C, it may be that C++ is actually just distributing generated code differently.


Join  post comment  

Constructors and object definitions

Dan Saks

3/2/2011 6:57 PM EST

C++ compilers generate translate object definitions into constructor calls. Dan explains what to expect from the generated code.


Join  post comment   5 comments    last comment  antiquus
A little bit of "object oriented" programming can go a long way in keeping your C code clean. The ...

1 - 10 of 87 > Next 10

Navigate to related information

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)