const
denotes that argument is not changed inside function and constant objects can be safely passed to it, and reference means that instead of copying we are creating alias to argument, and all operations are conducted on original object.Can I declare friend function as " friend Rectangle duplicate (Rectangle rect);" ? what is the difference between declaring as "friend Rectangle duplicate (Rectangle rect);" and "friend Rectangle duplicate (const Rectangle&);" ? |