I am having trouble understanding how to setup my functions within structs, this may have been covered before but in a slightly different way. Consider the code below written in C++,
//Struct containing useful functions.
typedef struct Instructions{
void W(float);
void X(float);
void Y(float);
void Z(int);
}instruct;
I have started but defining my struct with these void functions, however i wish to define what each function does in the program lets say,
void Z(int x){
do something...
}
Both the struct and the function were defined in the global. My question is would i have to refer to the function(in this case void Z(int x)) as:
void instruct.Z(int x){
do something...
}
or as i have previously done? Furthermore if there better ways of doing this please let me know.