#include<iostream>#include<ctime>usingnamespacestd;
// function to generate and retrun random numbers.int * getRandom( ){
staticint r[10];
// set the seed
srand( (unsigned)time( NulL ) );
for (int i = 0; i < 10; ++i) {
r[i] = rand();
cout << r[i] << endl;
}
return r;
}
// main function to call above defined function.intmain(){
// a pointer to an int.int *p;
p = getRandom();
for ( int i = 0; i < 10; i++ ) {
cout << "*(p + " << i << ") : ";
cout << *(p + i) << endl;
}
return0;
}