How to pass string array 'on the fly'

I have a function
Myfunction( string *data)

And I want to call it using Myfunction({"hello","data"})
But I cant get it, I have code error.

Any help ? Can I do this?
Well, C++ just doesn't allow that. It's a pity indeed. You'll have to declare an array before calling the function.
ok again... thanks
you could wait for the new feature of c++0x, template variadic
gcc4.5 already support this feature
htp://www.devx.com/cplus/Article/41533
Last edited on
Topic archived. No new replies allowed.