bjwf:
比如这样都行:LOGPRINT("dfasf%d--%s\n", 5, "fdsafds")("f1111111fdsafdsa")("%d", 1);
[阅读: 778] 2005-08-12 02:34:20
#include "stdafx.h"
#include <stdarg.h>
#define LOGPRINT log_function(__FUNCTION__, __LINE__)
typedef int (* print_func1)(const char * format, ...);
typedef print_func1 (*print_func)(const char * format, ...);
print_func myprint(const char * format, ...)
{
va_list ptr;
va_start(ptr, format);
printf(format, ptr);
va_end(ptr);
return (print_func)myprint;
}
print_func log_function(const char * pFunctionName, int lineNumber)
{
printf("%s %d", pFunctionName, lineNumber);
return (print_func)myprint;
}
int _tmain(int argc, _TCHAR* argv[])
{
LOGPRINT("dfasf%d--%s\n", 5, "fdsafds")("f1111111fdsafdsa");
return 0;
}