lundi 16 mars 2015

C++ call function with reference to array of const integers


Vote count:

0




Lets say i have these two function definitions:



int* first(int const (& array)[], int const size);
void second(int const array[], int const size);


and at the implementation of second i want to make a call to first like this:



void second(int const array[], int const size)
{
int* something = first(*array, size);
}


Thats when the compiler tells me: "no matching function for call to 'first'". What is the correct way to call first from second in this case?



asked 1 min ago







C++ call function with reference to array of const integers

Aucun commentaire:

Enregistrer un commentaire