|
From: Ioannis V. <no...@ho...> - 2003-01-27 23:51:09
|
-------Original Message-------=0D
=0D
From: Esteban Valverde=0D
Date: =C4=E5=F5=F4=DD=F1=E1, 27 =C9=E1=ED=EF=F5=DC=F1=E9=EF=F2 2003 5:53:=
21 =EC=EC=0D
To: dev-cpp=0D
Subject: [Dev-C++] printf=0D
=0D
Hi, I wish to overload the printf function to do the same thing plus othe=
rs,=0D
just like...=0D
=0D
void myprintf ( const char *format, ... )=0D
{=0D
// I do my work here=0D
=0D
printf( format, ... );=0D
}=0D
=0D
=0D
=3D=3D> This is not overloading, this is an ordinary separate function us=
ing
printf().=0D
=0D
=0D
=0D
How must I do to pass the variable argument list (...) from the definitio=
n=0D
of myprintf to the printf function ?=0D
=0D
=0D
=3D=3D> As you process arguments in all variadic functions (using pointer=
s).
However making your "printf()" will be much pain because you must process
all the arguments in const char *format.=0D
=0D
=0D
Ioannis Vranos=0D
=0D
* Programming pages: http://www.noicys.freeurl.com=0D
* Alternative URL: http://run.to/noicys=20 |