2003

Grusel++ of the month

Home
Download Source
/******************************************************************************/
/*                                                                            */
/*                                                            FILE: april.cpp */
/*                                                                            */
/*  An example for a function with variable arguments                         */
/*  =================================================                         */
/*                                                                            */
/*  Compiled and tested with Visual C++ 6.0                                   */
/*                                                                            */
/*  V1.00   30-APR-2003   P. Tellenbach   http://www.heimetli.ch/             */
/*                                                                            */
/******************************************************************************/

#include <iostream>

using namespace std ;

void print( char *pc )
{
   cout << *pc ;

   if( *pc != '\n' )
      print( pc + sizeof(int) ) ;
}

void printlist( char ch, ... )
{
   print( &ch ) ;
}
   

int main()
{
   printlist( 'H','e','l','l','o',' ','w','o','r','l','d',' ','!','\n' ) ;

   return 0 ;
}