Passing Arrays by Pointer
#include <iostream.h>
void InitArray(int*, int); //Prototype
void main()
{
int A[10];
InitArray(A, 10); //Function call
for (int i = 0; i < 10; i++)
{cout <<"Element at: "<< i << “= ";
cout << A[i] << endl;
}
}
Previous slide
Next slide
Back to first slide
View graphic version