Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #pass #arrays #reference
ADD COMMENT
Topic
Name
3+1 =