0
Hi everybody, Can you give me some exemples in what case we can use pointer in a program? Thank you.
4 Antworten
+ 1
Functions can be given something called a return type, this specifies what type of thing the function will spit out when it finishes. The problem is that it's one thing that comes out and the only way I'm aware of for changing multiple variables via a function is by passing in pointers/references. Sometimes making a function for one thing at a time isn't the solution; or perhaps an efficient one anyway.
+ 1
Thank you a lot Ahkrin. I understand why we can use them now. If i have others questions i will come back here.
0
If you need to affect two or more variables in a function you can pass pointers as arguments to the function as opposed to returning altered variables one at a time.
0
Thank you for your answer.
You said: to return altered variables one at a time!! Can youexplain me much better please, i don't understand.
Thx