Welcome, Guest. Please login or register.

Author Topic: Handy tool for C coders  (Read 2009 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
Handy tool for C coders
« 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 :)
int p; // A
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
Re: Handy tool for C coders
« Reply #1 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)
int p; // A
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show all replies
Re: Handy tool for C coders
« Reply #2 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:
int p; // A