Relative Content

Tag Archive for c++reference

What is the purpose of & before a function declaration here?

#include <simplecpp> int &f(int &x, int &y) { if (x > y) return x; else return y; } main_program{ int p=5, q=4; f(p,q) = 2; cout << p << ‘ ‘ << q << endl; cout << f(p, q) << endl; } (It’s a little simple version of C++ used to teach students). What I […]