Declare pointer to array

I have a function that writes the bytes of a file to ram.

To get a value from a specific ram adress I do

 
  int *pointerToSmth = (int*) (someAdress);


But how do I declare a pointer to an array?
Note that you can use array syntax on pointers too. If the pointer points to the first element in the array you can use the subscript operator to read and assign values from the array the same way you do with a normal array type.
1
2
3
int *arr = ....
arr[0] = 4;
cout << arr[1];
Last edited on
Thank you. That was exacly that I was searching for.
Topic archived. No new replies allowed.