Cześć chciałbym zapytać w jaki sposób zapisać jako makro taką funkcję:
struct tnode *alloc(void)
{
return (struct tnode *) malloc(struct tnode);
}
Moj pomysl (nie poprawny, sa bledy)
#define ALLOC1(t) ((t*) malloc(t))
//z wywolaniem:
struct tnode *alloc(void)
{
return ALLOC1(struct tnode);
}
Co robię źle ?