Will this work? I expect
foo(myArraypointer + 10);
be the same as
foo( &(myArraypointer[10]));
will this be treated as same for most compilers? Is this considered good or bad practice and why? What could go wrong?
For any pointer or array a and index i, the expression a[i] is equal to *(a + i). That means that &a[i] is equal to &*(a + i), where the last can be shortened to a + i.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With