Answers for "passing array to function"

C++
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
0

passing an array to a function

/**
* myFunction - receives an array param of 10 int variables
*/

void myFunction(int param[10]) {
   .
   .
   .
}
Posted by: Guest on August-04-2021

Code answers related to "passing array to function"

Browse Popular Code Answers by Language