What happened to _argptr ?

jcc7 technocrat7 at gmail.com
Wed Feb 7 07:21:58 PST 2007


== Quote from Tomas Lindquist Olsen (tomas at famolsen.dk)'s article
> I'm trying to compile a pretty simple C-style variadic function.
> extern(C)
> void error(char* fmt, ...)
> {
>         vprintf(fmt, _argptr);
> }
> This gives the error:
> Error: undefined identifier _argptr
> According to http://digitalmars.com/d/function.html this should at least
> compile.
> Whats up?

I couldn't get your code to work either, but the following code seems to work
(tested with DMD 1.0):

import std.stdio;

void foo(...)
{
    writefln("\t%s", _argptr);
}


void main()
{
    foo(1, 2, 3L, 4.5, 7F, "my str");
}


A longer example is at:
http://www.dsource.org/projects/tutorials/wiki/VariableArgumentsUsingStdStdargExample



More information about the Digitalmars-d mailing list