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
How would I get the address of a function?
Moderator: Coders of Rage
Re: How would I get the address of a function?
You could initialize the whole array with NULL. Then you can check if(!Ary_func[0]).
- MarauderIIC
- Respected Programmer
- Posts: 3406
- Joined: Sat Jul 10, 2004 3:05 pm
- Location: Maryland, USA
Re: How would I get the address of a function?
Or for clarity for you,K-Bal wrote:You could initialize the whole array with NULL. Then you can check if(!Ary_func[0]).
Code: Select all
if (Ary_func[0] != NULL) {
call it;
}
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.