[Dev-C++] Passing by value or reference to constructor initialiation list
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Daniel G. <sp...@ho...> - 2003-01-10 09:20:59
|
I would like to know whether it is better to pass the following string
objects and integer by value or reference to my constructor initialisation
list.
Vehicle::Vehicle
(
String& VehicleName,
String& VehicleType,
int SerialNumber
):
mVehicleName(VehicleName),
mVehicleType(VehicleType),
mSerialNumber(SerialNumber)
{
}
an integer is only 4 bytes I think, so by value would be fine, but what
about the string objects? Can I pass by reference?
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
|