1/* n_vargs.t:   Macro of variable arguments */
2/* from C99 Standard 6.10.3 Examples    */
3    #define debug( ...) fprintf( stderr, __VA_ARGS__)
4    #define showlist( ...)  puts( #__VA_ARGS__)
5    #define report( test, ...)  ((test) ? puts( #test)  \
6            : printf( __VA_ARGS__))
7    {
8        /* fprintf( stderr, "Flag");    */
9    debug( "Flag");
10        /* fprintf( stderr, "X = %d\n", x);     */
11    debug( "X = %d\n", x);
12        /* puts( "The first, second, and third items.");   */
13    showlist( The first, second, and third items.);
14        /* ((x>y) ? puts( "x>y") : printf( "x is %d but y is %d", x, y));   */
15    report( x>y, "x is %d but y is %d", x, y);
16    }
17
18