This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

is that possible?


hello all,

is the construction bellow valid in ansi C?

test("a",1)("b",2)("c",3);

Using some pointer-to-function magic i managed to get the form bellow,
but not the above one:

typedef void (test_fn)(char*, int);

test_fn *test(char *str,int len){
  /*...*/
}

test("a",1)("b",2);

Thanks in advance.

ps: i just want to know if such idiom could be valid, i'm aware of
fluent interfaces[1], i'm just want to know what i am missing of if
its indeed impossible.


[1]http://en.wikipedia.org/wiki/Fluent_interface


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]