Digital Puer wrote:
I have to convert some existing Java code into C/C++. One of the
Java classes implements Observable. Can someone suggest how
I might write this in C/C++? I'm thinking I would need something
like function pointers, but I've never used those... Thanks for
any help.
Why would you need function pointers?
Interfaces and base classes can be translated into C++ fairly directly.
Use std::vector to hold your observables and iterate through them when
doing notification.
I don't see where your issue is - I'd do this in C++ in almost exactly
the same way I'd do it in Java (this is a design pattern, not a language
issue)
Peter.