|
From: Esteban V. <est...@ho...> - 2003-01-27 17:17:28
|
That's mean that "(void _ss *) _va_ptr" is the way to obtain the variable
list of arguments ? For example
myprintf("%d%c%f", 1, 'a', 1.23);
the variable list (1, 'a' and 1.23) is passed to the printf inside the
function through (void _ss *) _va_ptr ?
bye
----- Original Message -----
From: "Goran Kavrecic" <go...@vo...>
To: "DevC++" <dev...@li...>
Sent: Monday, 27 January, 2003 13:03
Subject: Re: [Dev-C++] printf
Here you will find a sample of something i've done for a proprietary display
*.h:
int printfg( const char *fmt, ... );
*.cpp:
int printfg( const char *fmt, ... )
{
char out[200];
int i = vsprintf( out,fmt,(void _ss *) _va_ptr );
// out is formated as would be called sprintf
int x=getx();
int y=gety();
int dx=8*strlen(out)-1;
int dy=8;
dispmy( out,x+8*i,y );
return i;
}
----- Original Message -----
From: "Esteban Valverde" <est...@ho...>
To: "dev-cpp" <dev...@li...>
Sent: Monday, January 27, 2003 4:50 PM
Subject: [Dev-C++] printf
> Hi, I wish to overload the printf function to do the same thing plus
others,
> just like...
>
> void myprintf ( const char *format, ... )
> {
> // I do my work here
>
> printf( format, ... );
> }
>
> How must I do to pass the variable argument list (...) from the definition
> of myprintf to the printf function ?
>
> Bye, Esteban
>
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|