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

C++
0

passing array to the function c++

void myFunction(int param[]) {
   .
   .
   .
}
Posted by: Guest on May-04-2022
0

passing array to the function c++

void myFunction(int param[10]) {
   .
   .
   .
}
Posted by: Guest on May-04-2022
0

passing array to the function c++

double getAverage(int arr[], int size) {
  int i, sum = 0;       
  double avg;          

   for (i = 0; i < size; ++i) {
      sum += arr[i];
   }
   avg = double(sum) / size;

   return avg;
}
Posted by: Guest on May-04-2022
0

passing array to the function c++

//passing array as a pointer.
void myFunction(int *param) {
   .
   .
   .
}
Posted by: Guest on May-04-2022

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

Browse Popular Code Answers by Language