#pointer and array execution
35 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
is there any other way to print values[4]
instead of *(ptr + 4)
values[4] = &values[0] + 4
I mean if you want
you could make the pointer point to the end of the array
and offset backwards
&values[0] mean location of values[0]
am i right ?
or there is only one way
*(ptr +2)
so you can use the [] operator the same way
please write it once what you want to point
because ptr points to the beginning of values
values[4] = ptr[4]
so according to you
ptr[4] = *(ptr +4)
did i got right ?
f my vs code is shit
few minutes ago it was showing wrong output on using ptr[4]
thank you

@sweet parrot Has your question been resolved? If so, run !solved :)
!solved