1

Possible Duplicate:
Passing a constant array to a function in C/C++

void Bar (int *values) {}

void Foo ()
{
    int values[3] = { -5, 2, 8};
    Bar (values);
}

But i want something like the following. How can i make this possible?

void Foo ()
{
    Bar ({5,2,8}); //error C2143: syntax error : missing ')' before '{'
}
Community
  • 1
  • 1
jack-london
  • 1,599
  • 3
  • 21
  • 42
  • another similar topic: http://stackoverflow.com/questions/161790/initialize-a-const-array-in-a-class-initializer-in-c – jack-london Jul 29 '10 at 21:32
  • See [this question](http://stackoverflow.com/questions/1269568/passing-a-constant-array-to-a-function-in-c-c). – quantumSoup Jul 29 '10 at 19:53

0 Answers0