1. Home
  2. Computing & Technology
  3. C / C++ / C#

Definition of Pass By Reference

By David Bolton, About.com

Definition: In C and C++, parameters to a function are passed by value. This makes a copy of the variable and can be quite slow and inefficient if the variable is large like an array.

Pass by Reference passes in a reference to a variable - this is effectively the address of the variable into the function. This is considerably more efficient than by value and allows the function to change the variable directly, something only possible in C by passing in a pointer to the variable.

Glossary:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Explore C / C++ / C#
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. C / C++ / C#
  4. Glossary
  5. Pass By Reference - Definition

©2009 About.com, a part of The New York Times Company.

All rights reserved.