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
What is c++ redistributable?
Should I learn c or c++ first?
Can we make any program in c++ without using any header file and what is the shortest program in c++.
A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a saleperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of items sold by each salesperson. The values of these items are as follows: Item Value A 239.99 B 129.75 C 99.95 D 350.89 Write a program that inputs one salesperson's items sold in a week (how many of item A? of item B? etc.) and calculates and displays that salesperson's earnings for that week.
What are all predefined data types in c++?
why and when we can declar member fuction as a private in the class?
What is object in c++ example?
What is a c++ object?
What are advantages of using friend classes?
Does c++ support multilevel and multiple inheritances?
Why do we use pointers in c++?
Why can templates only be implemented in the header file?
Reverse the Linked List. Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL
Is rust better than c++?
What is ios :: in in c++?