help with syntax error

I have a section of code that works:

void StartFunc1(void (*f)(void)) {
int a = (int) f;
}

void main() {
StartFunc1((void(*)(void))Func2);
}

When I tried to combine the code, this didn't work

void main() {
int a = (int) ((void (*f)(void))Func2);
}


Any help is appreciated!
First of all, what is the error message your compiler gives you?
Second, which compiler are you using?

Why are you casting a void to int?
Why are you using a function pointer here?

What exactly are you doing here?

Please explain so that you can get the help you need :)
Topic archived. No new replies allowed.