Answers for "c++ are arrays passed by reference"

C++
-1

how to pass arrays by reference c++

#include <iostream>
using namespace std;
void show( int *num) {
   cout<<*num;
}
int main() {
   int a[] = {3,2,1,6,7,4,5,0,10,8};
   for (int i=0; i<10; i++) {
      show (&a[i]);
   }
   return 0;
}
Posted by: Guest on June-27-2021

Browse Popular Code Answers by Language