Thu Nov 13, 2008 2:17 pm
#include <iostream>
using namespace std;
// This simply sets a to a function of b.
void fred(int &a, const int &b)
{
a = 2 * b * b;
// This would be illegal:
// b = 10;
}
main()
{
int m;
fred(m, 17);
cout << "m = " << m << endl;
int c = 45;
fred(m, 2*c + m);
cout << "m = " << m << endl;
}
|
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.