By three today I need this problem solved!
For a class I''m suppost to write a program with a class set up like this\
class machine{
typedef void (machine::*fnctptr)();
fnctptr parcerarray[commands];
//all other crap I don''t feel like writing
};
Now I''m suppost to access an element of the array in a method of the class
this->*(parcerarray)();//I get identifier error,also how teach told me to do it.
parcerarray();//I get non-function error
machine::parcerarray();//same as above, I tried all arrangments of typecasting
</source>
What do I do? </i>
NEED HELP FAST!!!!!!!
a.h{text-decoration:none;color:blue;};a.h:hover{text-decoration:underline;background:red;};
Why is it called a hot water heater? Isn't it cold when it goes in the tank?
[email=jtaylor@gtemail.net" class="h]-=CF=-[/email]If you have an array of function pointers and you want to call a function based on an index, you should use something like:
(function_pointer_array[ index ])( my_param );
if ''parcearray'' is a member of ''machine'' you don''t need ''machine::'' or ''this->'' to access it within ''class machine''.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement