Pass-by-reference, and pass-by-value?
-
I want to assign the pointers in my array a value. So I can do this: int height = 5; int **int_array_pointer = (int *) main_pointer; //a casted pointer; irrelevant to question) int_array_pointer[0] = &height; //pass by reference Or *int_array_pointer[0] = 5; // pass by value --------------------------------------… are my comments correct on the examples?
-
Answer:
No. The concepts of "pass by reference" and "pass by value" refer to how parameters are internally passed to function calls. When function calls use "pass by reference", that means that the address of the object is put onto the stack (or registers) to pass to the function. When "pass by value" is used, that means that the object value itself is passed to the function.
Nace at Yahoo! Answers Visit the source
Related Q & A:
- How to pass javascript jQuery variable value in php array?Best solution by Stack Overflow
- Is Java pass by value or pass by reference?Best solution by Stack Overflow
- How to properly reference a user control and dynamically add it to page?Best solution by Stack Overflow
- How to pass the value from the javascript to servlet?Best solution by Stack Overflow
- Can the disneyland summer pass be used towards a new disneyland pass?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.