Welcome, Guest. Please login or register.

Author Topic: Handy tool for C coders  (Read 2000 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 only replies by Karlos
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 SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2280
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: Handy tool for C coders
« Reply #1 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.
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
Re: Handy tool for C coders
« Reply #2 on: August 29, 2011, 04:17:28 PM »
What does (^) mean?
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2280
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: Handy tool for C coders
« Reply #3 on: August 29, 2011, 04:21:01 PM »
It's an exclusive or operator but the program on the website only covers variable declarations.
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
Re: Handy tool for C coders
« Reply #4 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.
« Last Edit: August 29, 2011, 05:28:00 PM by ChaosLord »
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2280
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: Handy tool for C coders
« Reply #5 on: August 29, 2011, 05:15:11 PM »
--never mind-- Karlos had the answer.
« Last Edit: August 29, 2011, 05:17:10 PM by SamuraiCrow »
 

Offline KarlosTopic starter

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Handy tool for C coders
« Reply #6 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 only replies by Karlos
Re: Handy tool for C coders
« Reply #7 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
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
Re: Handy tool for C coders
« Reply #8 on: August 29, 2011, 05:35:05 PM »
Blocks, Thunks and Closures...  ow.  My brain hurts.
Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA