-3

I've got an assignment that is due tomorrow.. I don't want the entire solution, there's just a part of the program that i dont understand.

It's highlighted in the image below: (I dont know what "save the values into the parameters of a method" means) 1

Ðаn
  • 10,934
  • 11
  • 59
  • 95
  • 1
    Welcome to Stack Overflow. Please take the time to go through the [The Tour](http://stackoverflow.com/tour) and refer to the material from the [Help Center](http://stackoverflow.com/help/asking) on what and how you can ask here.It's specially important to post a [mcve]. Please don't post a link to an image. Copy and paste the code and the error in textual form. – R Sahu Mar 29 '21 at 18:06
  • 1
    Please don't post image links, post source code. We will typically not follow links and will only consider the text you posted. I am also guessing posting image links will get you downvotes :-( – einpoklum Mar 29 '21 at 18:18

1 Answers1

0

As you can see the type of the parameters is double& which means you are storing the values within the arguments you are sending. e.g, if you have 3 doubles a,b & c, when you call getAll(a,b,c) the result should be stored in them.

You can find more detailed explanation about &(reference) operator in What does '&' do in a C++ declaration? .

Hook
  • 355
  • 1
  • 7
  • First of all, thank you for responding. Secondly, so I can use the function to store the value of the class members in variables that are within the main function? – Bisher Alazzeh Mar 29 '21 at 18:26
  • Exactly. When you are storing class members to the parameters within getAll, you are actually saving them to the passed parameters (i'm guessing you are calling it from main), and that is possible because you are sending them by reference (&) instead by value. – Hook Mar 29 '21 at 18:56