Amiga.org

Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Karlos on August 29, 2011, 03:53:15 PM

Title: Handy tool for C coders
Post by: Karlos on August 29, 2011, 03:53:15 PM
After some time messing around with lesser languages, I found I forgot some of my C declaration syntax for some of the more exotic pointer types.

Anyway, I stumbled (actually, now that I think about it, I recall that maybe nicholas mentioned this one to me before) across the following site which is quite handy:

http://cdecl.org/

Enjoy :)
Title: Re: Handy tool for C coders
Post by: SamuraiCrow on August 29, 2011, 04:14:37 PM
I remember seeing this on a Fred Fish disk many years ago.  It's cool that they made a web site version though.
Title: Re: Handy tool for C coders
Post by: ChaosLord on August 29, 2011, 04:17:28 PM
What does (^) mean?
Title: Re: Handy tool for C coders
Post by: SamuraiCrow on August 29, 2011, 04:21:01 PM
It's an exclusive or operator but the program on the website only covers variable declarations.
Title: Re: Handy tool for C coders
Post by: ChaosLord on August 29, 2011, 04:53:40 PM
The 3rd example disgorges the following rumination:
Code: [Select]
(double (^)(int , long long ))foo

I don't understand.
Title: Re: Handy tool for C coders
Post by: SamuraiCrow on August 29, 2011, 05:15:11 PM
--never mind-- Karlos had the answer.
Title: Re: Handy tool for C coders
Post by: Karlos on August 29, 2011, 05:15:12 PM
Quote from: ChaosLord;656706
The 3rd example disgorges the following rumination:
Code: [Select]
(double (^)(int , long long ))foo
I don't understand.

Don't feel bad about that, it's not remotely standard C syntax, rather an Apple extension to C, called "blocks" which aim to mirror the functionality of lambda expressions in more recent languages.

More here: http://en.wikipedia.org/wiki/Blocks_(C_language_extension)
Title: Re: Handy tool for C coders
Post by: Karlos on August 29, 2011, 05:27:27 PM
Quote from: SamuraiCrow;656709
--never mind-- Karlos had the answer.


Still, it doesn't happen often :lol:
Title: Re: Handy tool for C coders
Post by: ChaosLord on August 29, 2011, 05:35:05 PM
Blocks, Thunks and Closures...  ow.  My brain hurts.