>>40
this works only with one type
No, it doesn't.
Yes, it does. That's a consequence of being able to use the macro only once:
you can't use the macro twice
Yes, I can.
No, you can't. If you use it twice, you have two conflicting prototypes in scope. For instance:
/* MAPCAR_INSTANCE(char);
expands to:
*/
char *mapcar(char (*)(char *), char *, size_t);
/* MAPCAR_INSTANCE(int);
expands to:
*/
int *mapcar(int (*)(int *), int *, size_t);
As you see, these are two conflicting prototypes. You can solve this problem by adding some C pp tokenizer magic (# or ##), but even then, you'll create mapcar_int, mapcar_char, but you'll be unable to create a mapcar for arrays or pointers (mapcar_char* isn't a valid identifier in C).
simply because you have to enter the type name anyway inside the body of the function (to access data).
No, I don't.
Elaborate on that; you haven't demonstrated how you actually implement mapcar without that.
Go back to learning C before trying to discuss it.
There's nothing for me left to learn; I've studied ISO 9899:1999 and I've memorized a fairly big part of it.