D
darklight
Which is the correct way, to initialise a pointer to an element of
an array. I am sorry if my terminology is not correct
/* declare pointer */
int *ptr;
/* define and initialise array */
int array[10] = {,0,1,2,3,4,5,6,7,8,9};
/* assign value to pointer */
ptr = &array[9]; or ptr = (array + 9);
I have found both work but to avoid future problems is one
better than the other. And if so why
an array. I am sorry if my terminology is not correct
/* declare pointer */
int *ptr;
/* define and initialise array */
int array[10] = {,0,1,2,3,4,5,6,7,8,9};
/* assign value to pointer */
ptr = &array[9]; or ptr = (array + 9);
I have found both work but to avoid future problems is one
better than the other. And if so why