use of .... (variable arguments to a function)

Programming, for all ages and all languages.
User avatar
suthers
Member
Member
Posts: 672
Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:

Re: use of ....

Post by suthers »

Thanks, but I develop on XP.... :wink: :twisted:
But I'll be swapping it or a linux distro sometime during the holiday...
Thanks,

Jules
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: use of ....

Post by pcmattman »

suthers wrote:Thanks, but I develop on XP.... :wink: :twisted:
Unless you're using some obfuscated development environment you will have stdarg.h on Windows.
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: use of ....

Post by AndrewAPrice »

You could use the preprocessor so you're actually passing a reference to a vector of arguments in.
My OS is Perception.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: use of ....

Post by JamesM »

That would however mean he'd have to implement the STL in his operating system...
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: use of ....

Post by AndrewAPrice »

Or write a quick templated linked list class :) (though you require C++).

One where each object can be of a different class, much like an array of Ogre::Any class. Ogre::Any is a class in the OGRE rendering engine that you can attach anything to. This isn't required if you already know the type to add.

If you're using C you can also whip up a similar linked list struct.
My OS is Perception.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: use of ....

Post by JamesM »

The OGRE::Any class (as well as the Boost equivalent) requires RTTI too, if I'm not mistaken...?
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: use of ....

Post by AndrewAPrice »

As far as I know, no since it uses templates. Here's the code for it: http://www.ogre3d.org/docs/api/html/Ogr ... ource.html
My OS is Perception.
Post Reply