Answers for "passing array to function c++ pointer"

C++
12

array as parameter c++

void myFunction(int param[]) {
   .
   .
   .
}
Posted by: Guest on May-08-2020
4

passing array to function c++ pointer

void generateArray(int *a, int si)
{
    for (int j = 0; j < si; j++)
        a[j] = rand() % 9;
}

int main()
{
    const int size=5;
    int a[size];

    generateArray(a, size);

    return 0;
}
Posted by: Guest on June-23-2020

Code answers related to "passing array to function c++ pointer"

Browse Popular Code Answers by Language