Explain "passing by value", "passing by pointer" and
"passing by reference" ?
Answer Posted / sampurna pandey
i am not agree with Ranjeet, you mention this
main()
{
int i;
func(i); // call by reference
}
but fun(i) is a call by value not call by reference
your code will give compile error.
Ven eample is right.
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
How many characters are recognized by ANSI C++?
Can a constructor be private?
Which software is best for programming?
Can we distribute function templates and class templates in object libraries?
What is an accessor in c++?
What is atoi in c++?
What is array in c++ example?
What is the difference between an array and a list?
Should I learn c or c++ first?
Do you know the problem with overriding functions?
What is the difference between *p++ and (*p)++ ?
What are the data types in c++?
What is the difference between set and map in c++?
how can i access a direct (absolute, not the offset) memory
address?
here is what i tried:
wrote a program that ask's for an address from the user,
creates a FAR pointer to that adress and shows it. then the
user can increment/decrement the value in that address by
pressing p(inc+) and m(dec-).
NOW, i compiled that program and opened it twice (in 2
different windows) and gave twice the same address to it.
now look what happen - if i change the value in
one "window" of the program, it DOES NOT change in the
other! even if they point to the same address in the memory!
here is the code snippet:
//------------------------------------------------------
#include What is buffer and example?