// Code derived from Stroustrup's PPP2 book// § 8.5.3 Pass-by-value// -and beginning on p 275#include<iostream>usingnamespacestd;intf(intx)// pass-by-value (give the function a copy of the value passed){x=x+1;// give the local x a new valuereturnx;}intmain(){intxx=0;cout<<f(xx)<<endl;// print: 1cout<<xx<<endl;// print: 0; f() doesn't change xxintyy=7;cout<<f(yy)<<endl;// print: 8cout<<yy<<endl;// print: 7; f() doesn't change yy}