title: Print Array from pointer
body: <p>Hello guys I have a question,</p>
  
  <p>I have an array with 10 elements and a function which returns me a pointer to a randomly chosen element in the array. Now I want to print the array from this element the pointer points to, how can I do that.</p>
  
  <p>Example:
  Array: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
  Pointer points to Element 6.
  I want to print: 6, 7, 8, 9, 10</p>
  
  <p>Code looks like this in C:</p>
  
  <pre><code>int* randomElement(int* array, int size) {
      int* pointer = NULL;
      int randomNumber = 0;
      randomNumber = rand() % size;
      *pointer = *(array + randomNumber);
      return pointer;
  }
  
  int main(void) {
      int size = 10;
      int array[size];
      int* pointer = NULL;
  
      srand(time(NULL));
  
      pointer = randomElement(array, size);
      /* Want to print the array from this element here */
  
      return EXIT_SUCCESS;
  }
  </code></pre>