Thread: Idle curiosity: What is a Block?

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    107

    Idle curiosity: What is a Block?

    I was on cdecl and I encountered a strange construct:
    Code:
    (double (^)(int , long long ))foo
    Apparently, it means "cast foo into block(int, long long) returning double."

    Then I googled "C blocks" and got a whole bunch of unrelated crap about scope and braces. Does anyone happen to know off hand what it is?

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    C++/CLI crap if I'm not mistaken. Cannot see the original source, though, so cannot confirm.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    107
    I remember the evil monstrosity which is Managed Visual C++:
    Code:
    array<MyClass ^> ^ MyArray = gcnew array<MyClass ^>(100);
    I am not sure if they are related. I sincerely hope not. I know they have something called a "top-level" whatever the hell that is. I wrote in that language for about three days and got bored quickly.

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    All I can say is that
    (double (^)(int , long long ))
    is not valid C.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    639
    Its the declaration for a closure like construct in Apple versions of C/C++/Obj-C.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory Leak in AppWizard-Generated Code
    By jrohde in forum Windows Programming
    Replies: 4
    Last Post: 05-19-2010, 04:24 PM
  2. Compiling C in Visual Studio 2005
    By emanresu in forum C Programming
    Replies: 3
    Last Post: 11-16-2009, 04:25 AM
  3. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 03:42 PM
  4. HUGE fps jump
    By DavidP in forum Game Programming
    Replies: 23
    Last Post: 07-01-2004, 10:36 AM
  5. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM