& org

(const String& org, const String& app) Can someone tell me what org. stands for in the previous argument, and if its not asking too much, what is the purpose of org.
org is just the name of the variable/parameter being passed to a function.

example:
1
2
3
4
5
6
7
8
9
10
11
12
int main()
{
  int a = 1; //a is a variable name
  string name("John"); // name is a variable name
  float cost = a / .75; //cost is a variable name
  PrintName(name); //See below for implementation of PrintName...
}

void PrintName(const string &org) //org is just a variable name (Bad one for this example)
{
   cout << org << endl;
}


And the type of org is const string& in this case, which reads "reference to a constant string".
Topic archived. No new replies allowed.