Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 11. Constructors and Destructors... > More on Passing Objects by Value

More on Passing Objects by Value

Earlier, in Chapter 7, "Programming with C++ Functions," I argued against passing objects to functions as value parameters or as pointer parameters and promoted passing parameters by reference instead.

I explained that pass by reference is almost as simple as pass by value, but it is faster—for input parameters that are not modified by the function. Pass by reference is as fast as pass by pointer, but its syntax is much simpler—for output parameters that are modified by the function in the course of its execution.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial