3 ms·
I think I've been writing C for well over 10 years now and this year was finally the one where I forced myself to remember function pointer declarations. I don'
by dailykoder 2y ago
I think I've been writing C for well over 10 years now and this year was finally the one where I forced myself to remember function pointer declarations.
I don't even know why it took me so long to remember such a simple thing, but possibly writing "c function pointer" into my favorite search engine and hitting enter was faster than thinking about it for a moment.
But maybe also because I changed up my general programming approach a bit and try to think a bit longer before hitting up a search engine. Also forced myself to read more reference sheets than stackoverflow or chatgpt. And I must say, this made me a lot more comfortable, because I understand more. Can recommend to go through the struggle/10
- shrimp_emoji 2y agoWhen they're function parameters, you can write them as regular function declarations, btw. ;) Might hurt your memorization efforts though.
- scoutt 2y agoI thought it was just me, that after 20 years of writing C I still have to look how to declare function pointers.
- jandrese 2y agoI'm weird that I have no problem getting function pointers but have to look up the syntax to declare an enum every damn time.
- nuancebydefault 2y agoWhat i usually do is: Write a normal function declaration, prepend it with typedef and append _t to the function name. DONE The same trick works for anything you want to typedef!