b3ta.com board
You are not logged in. Login or Signup
Home » Messageboard » Message 4513022 (Thread)

# I can stop doing stupid stuff at any time
but C wont.
(, Sun 17 Apr 2005, 23:38, archived)
# C is all logic.
And I love it. I want to have its babies. I love function pointers.

void *(*t)(void *);
t = (void *(*)(void *))return_function();
(void)t(NULL);
(, Sun 17 Apr 2005, 23:44, archived)
# Bet that'd belm up for no reason
(, Sun 17 Apr 2005, 23:48, archived)
# Only if the function return_function returns a NULL pointer.
I also love the weakly typedness of C.
(, Sun 17 Apr 2005, 23:51, archived)
# I sometimes use function pointers
but I don't know what that says.
It looks like it declares a function that takes a void pointer, and then the function is cast as a pointer (and it returns a void pointer). What does that mean?
*gets out K&R*
*remembers brackets associate left to right*
hang on a minute.
OK, I vaguely remember that the parentheses are needed in order to declare a pointer to a function instead of just declaring a function that returns a handle. I get the impression that what you've made is a pointer to a function that takes a pointer to a function and returns a pointer to a function, maybe, not sure.
*goes to bed*
(, Mon 18 Apr 2005, 0:03, archived)
# I like languages like perl,
where you can tell if someone has a background in C when you look at the code.
Apart from that, the only C I look at is the C I am hoping is something else.
(, Mon 18 Apr 2005, 0:04, archived)