I'm new to C++ and I cannot figure out how pointers work in relation to arrays. I do cannot figure out how I am supposed to access an element in an array pointer. Here's what I mean:
int* array[10];
(*array)[5] = 4;// This works but I don't think that that is the correct way to do it
array->[5] = 4; // Is there a similar method such as what you would use for a normal pointer?
Also I was wondering if you could initialize an array pointer like you can initialize a regular array with an array in curly brackets.
int array[] = {0, 2, 45, 235};// Works
int* array[] = {0, 2, 45, 235};// does not work
int* array[] = &{0, 2, 45, 235};// does not work
EDIT: Some of you are suggesting to use an array without a pointer. But if i do this, wont it make a copy whenever i pass it into a method like with normal variables?