// Function getarray(N,x) creates an array
// of N ints, sets each int to x, returns a
// pointer to the front of the array
int* getarray(int N, int x)
{
  // Create array
  int* A = new int[N];

  // Initialize values to x
  for(int i = 0; i < N; i++)
    A[i] = x;
  
  // Return pointer to the array
  return A;
}