2001

Grusel++ of the month

Home
Download Source
/******************************************************************************/
/*                                                                            */
/*                                                         FILE: november.cpp */
/*                                                                            */
/*  printf, C++ - style                                                       */
/*  ===================                                                       */
/*                                                                            */
/*  Compiled and tested with Visual C++ V7.0 BETA                             */
/*  When compiled with VC6.0, it will NOT work as intended !!                 */
/*                                                                            */
/*  V1.00   30-NOV-2001   P. Tellenbach   http://www.heimetli.ch/             */
/*                                                                            */
/******************************************************************************/

#include <iostream>

using std::cout ;
using std::endl ;

char *s = "Hello world !" ;

template< char *str >
int printf( const char *, ... )
{
   cout << str << endl ;

   return int() ;
}

int main( void )
{
   return printf<s>( "printf( %d, %c, %s ) ;\n", 1, '2', "3" ) ;
}