A short reply to some questions (question 3 is quite long to be properly answered, and you can find good explanations both on the web and on books).
1) Your answer is right. And you can use only static and local variables within a static function.
2) Yes, they are class members. But you just have to try to find out.
3) Short answer: they are functions which a derived class can redefine. Then at runtime...
User Profile
Collapse
-
Indeed the declaration of srand in stdlib.h is void srand(unsigned) , and not int srand(unsigned) , so this code does not compile to me.
which is obviously to obtain a random number between 1 and 100, which as noticed will not be so random after all.
Sandro...Leave a comment:
-
This is an update on my own message.
First forget about the fact that I cannot register the initializer from the constructor of the base class ParametersIniti alizer. Indeed now I do, I don't know why I had problems with virtual functions before (but I had them), now they seem to have disappeared.
I found out that having the PointerList object as a static member of ParametersIniti alizer partially solves the issue. Doing...Leave a comment:
-
Wrong static initialization order
Hello everybody, my first message on this forum. I tried to solve my issue by reading other similar posts, but I didn't succeed. And forgive me if this mail is so long.
I'm trying to achieve the following (with incomplete succes): I want in a given namespace Parameters a list of "initialize rs" (which are objects derived from a simple interface that can be implemented anywhere, and are used to define which parameters the program...
No activity results to display
Show More
Leave a comment: