How would I get the address of a function?
Posted: Mon Mar 30, 2009 11:13 pm
Title says most.
Unless functions are not copied when they are transfered from arguments I'm going to want to use pointers.
This is what I have now:
void doStuf() { }
void (*Ary_func[300])();;
Ary_func[0] = &void doStuf();
>.< Scratch this.
I couldn't have the () or it would call the function.
Slightly new question.
How would I tell if a function was stored at Ary_func[0]? It is stored as true but I'm not sure how to compare it Ary_func[0] != true always gets a cannot convert error.
I tried usingif(*Ary_func[0] == true) but it gets a cannot compare pointers error
Unless functions are not copied when they are transfered from arguments I'm going to want to use pointers.
This is what I have now:
void doStuf() { }
void (*Ary_func[300])();;
Ary_func[0] = &void doStuf();
>.< Scratch this.
I couldn't have the () or it would call the function.
Slightly new question.
How would I tell if a function was stored at Ary_func[0]? It is stored as true but I'm not sure how to compare it Ary_func[0] != true always gets a cannot convert error.
I tried usingif(*Ary_func[0] == true) but it gets a cannot compare pointers error