Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
bstamour
on Jan 19, 2017
|
parent
|
context
|
favorite
| on:
How Do I Declare a Function Pointer in C?
Yeah, typedefs solve the problem for fixed types. I guess you could use a macro to create a generic FUNC_PTR or something as well.
ramshorns
on Jan 19, 2017
[–]
Macros are often a bad idea for defining types. If you do
#define INT_PTR int* INT_PTR p, q;
the code is actively misleading. Is there a better way to do it for function pointers?
flukus
on Jan 19, 2017
|
parent
[–]
There are a few other problems with multiple declarations aren't there? I though they were discouraged in c.
Consider applying for YC's Spring batch! Applications are open till Feb 11.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: