Re: is that possible?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6 September 2011 14:23, Leonardo wrote:
> hello all,
>
> is the construction bellow valid in ansi C?

Yes, but this isn't a question about GCC, so would be more suitable on
a general C programming list, newsgroup or forum.

Using typedefs makes the syntax much easier:

typedef void (*func1_type)(const char*, int);
typedef func1_type (*func2_type)(const char*, int);

void       func1(const char* s, int i) { }
func1_type func2(const char* s, int i) { return &func1; }
func2_type func3(const char* s, int i) { return &func2; }

int main()
{
    func3("a",1)("b",2)("c",3);
}


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux