Original Post
Hiya!
I''ve recently run into somewhat of an interesting issue.
I''m writing a program to plot chaotic attractors (the what and how of these little buggers isn''t important for the purpose of this question though I''ll gladly elaborate) to further my understanding of the Win32 API (Mostly controls; I''ve limited myself mostly to simple full-screen graphic demos and games prior to this. Good understanding of the GDI and DirectX, though before this project I had no clue how, say, a listbox works). The program allows the user to choose a variety of "sets" to plot from a list.
Now here''s my problem. Once the user selects a set and decides to plot it, there''s a bit of initialization where the parameters are initialized and a pointer to the function that calculates the attractor is returned. That way, instead of having a HUGE switch() block in my code, I can just include the attractors themselves in an other .cpp and not have to worry about them when working on the program itself.
Only thing is, right now, I have over 60 attractors and a recent addition to the program means I''m probably going to easily double that number sometime soon. This is all fine and well but I''m starting to have a lot of prototyping in my .h and my function that returns a pointer to the attractor function is getting to be somewhat yucky too.
Is there a way to make, I dunno, an array of functions, such as...
void SAFunction[35] (parameters...)
{
}
Or is there a better work-around? My code is getting a bit icky and kinda hard to manage, so I''m not really sure what to do other than either grin and bear it or find a better solution.
I''ll gladly provide any additional information if necessary.