Re: function call argument count

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Don,

There's not an easy way that is platform agnostic to determine the argument count. You can do it yourself as a convention:

void MyFunc(int argcount, ...);

Then call it with the explicit argument count, via:

int a=1, b=2, c=3;
MyFunc(3, a, b, c);

I recommend that variable arguments be passed in as a std::vector<> or std::map<> or std::set<> or whatever kind of container is appropriate. Or better yet, as generic begin() and end() iterators to the aforementioned containers. By "generic" I mean using templates.

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux