[ create a new paste ] login | about

Link: http://codepad.org/7R6lQ0Cb    [ raw code | output | fork ]

aaronla - C, pasted on Oct 23:
1
2
3
4
5
6
7
8
9
10
11
/* simple tuples */
#define LISTSIZE(S) LISTSIZEx S
#define LISTSIZEx(...) LISTSIZExx(__VA_ARGS__, 5,4,3,2,1)
#define LISTSIZExx(a,b,c,d,e,N, ...) N

int main()
{
    printf("%d\n", LISTSIZE((1,2,3)));
    printf("%d\n", LISTSIZExx(1,2,3, 5,4,3,2,1));
    return 0;
}


Output:
1
2
3
3


Create a new paste based on this one


Comments: