#Reverse an array using pointers

30 messages · Page 1 of 1 (latest)

clever wyvern
#

when I've declared s=*(arr(n-1-i)) its showing an error. How do I write arr[n-1-i] in the form of a pointer

spiral lanceBOT
#

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 use !howto ask.

#

@clever wyvern

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

clever wyvern
#

where n is the size of the array

random halo
#

I would use pointer arithmetic in the loop, but I am weird.

clever wyvern
#

i declared it as a pointer

random halo
#

Hang on, you have a double pointer as a parameter there.

clever wyvern
#

right

#

thank you

#

and moreover it would be call by reference right if i dont use pointers also ??

crisp haven
#

Call function.

clever wyvern
#

sorry typo

crisp haven
#

Not sure what you mean by that.

clever wyvern
#

pointer in functions are of two types

#

call by vale

#

and

#

call by reference

crisp haven
#

No they aren't.

#

There is no such distinction.

clever wyvern
clever wyvern
#

i saw that in one of a tutorial

#

thats why asked

spiral lanceBOT
#

@clever wyvern Has your question been resolved? If so, type !solved :)

crisp haven
clever wyvern
#

👍🏻🗿

#

!solved