Thanks Marcel, that fixed that error. Now I'm getting the error:
'pValidator' undeclared (first use this function)
?????
Help again.
Thanks Marcel, that fixed that error. Now I'm getting the error:
'pValidator' undeclared (first use this function)
?????
Help again.
on which line in the code this error comes?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
The error is on this line:
Validated_State = (*State_Tbl[Object].pValidate_State)(Requested_State);
Doug
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Validated_State = (State_Tbl[Object].*pValidate_State)(Requested_State);
Who is pValidate_State?
You should call (State_Tbl[Object].*pValidator)(Requested_State);, because pValidator points to State::Validate_State.
What is the point of pointers to functions if you will call the functions directly?
Oops, you're right, the actual line that is generating the error is the edited one:
Validated_State = (State_Tbl[Object].*pValidator)(Requested_State);
My mistake in copying/simplifying the code and having 'pValidate_State' instead of the correct 'pValidator' here. It still gets the 'pValidator undeclared' error.
Doug
Just realized one problem, I haven't instantiated any State objects yet to point to!
My newbe status reveals itself yet again.
Doug
Bookmarks