+ 1

If an array in c behaves like an pointer, it is any use to initialize a pointer to the array?

27th Mar 2020, 4:30 PM
Cristian Daraban
Cristian Daraban - avatar
2 Answers
+ 2
Using pointer notation is quicker than array notation (apparently), ..plus you can't increment/decrement (++/--) an array name but you can increment/decrement a pointer..example:- int myArr[] = {1,2,3,4,5,6}; int *pmyArr = myArr; printf("%d", ++myArr); // <- you can't do this...but.. printf("%d", *++pmyArr); // <- you can do this. although.. printf("%d", *(myArr+1)); // <- you can do this.
27th Mar 2020, 6:34 PM
rodwynnejones
rodwynnejones - avatar
+ 2
Hey Cristian Daraban your question seem unclear if you dont mind putting it to code
27th Mar 2020, 5:22 PM
✳AsterisK✳
✳AsterisK✳ - avatar