dimanche 4 septembre 2016

How to use a numerical array literal

I would like to use an array for one time only, and would like to not having to declare a name for it, e.g, something like

int a,b,c;
void foo(int[],int);
...
a=1; b=2; c=3;
foo({a,b,c},3);
...

I am pretty sure this is not going to work, but how can I make it work?

Aucun commentaire:

Enregistrer un commentaire